<div dir="ltr">In the description for avcodec_free_frame, it states:<div><br></div><div><span style="color:rgb(0,0,0);font-family:Roboto,sans-serif;font-size:14px;line-height:19px">"Warning: this function does NOT free the data buffers themselves"</span><br>

</div><div><br></div><div>I have allocated my buffers as such:</div><div><div><div>int curAVFramesize = avpicture_get_size(PIX_FMT_YUV420P, ccontext->width, ccontext->height);</div><div>uint8_t* curAVFramePicBuffer = (uint8_t*)(av_malloc(curAVFramesize));</div>

<div>AVFrame *curAVFrame=avcodec_alloc_frame();</div><div>avpicture_fill((AVPicture *)curAVFrame,curAVFramePicBuffer, PIX_FMT_YUV420P,ccontext->width, ccontext->height);</div></div><div><br></div><div><br></div><div style>

I figured that the warning meant calling 'avpicture_free' was nessecary. So I've been freeing it as:</div><div style><div>avpicture_free((AVPicture *)curAVFrame);</div><div>avcodec_free_frame((AVFrame **)(&curAVFrame));</div>

</div><div style><br></div><div style>Usually my program doesn't complain but every once in a while, after calling 'avpicture_free' but before 'avcodec_free_frame' it'll throw a heap allocation error.</div>

<div style><br></div><div style>Here is the entire function: <a href="http://pastebin.com/jHecUySU">http://pastebin.com/jHecUySU</a></div><div style><br></div><div style>Is avpicture_free needed?  Any thoughts as to what might be happening?</div>

<div><br></div><div style>Thank you!</div><div style>Matt</div><div><br></div>-- <br><div dir="ltr">Matt Czarnek, Software Engineer<div><div>Work Phone:  (760) 4-OBJVID   </div><div>             aka:  (760) 462-5843</div>

</div><div><br></div><div>Cell Phone: HAHAHOORAY</div><div><br></div><div><p style="margin:0px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)"><font size="4">ObjectVideo Inc.</font></p>

<p style="margin:0px;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="font-size:10.5pt"><a href="http://www.objectvideo.com/" style="color:rgb(17,85,204)" target="_blank">http://www.objectvideo.com</a></span></p>

</div></div>
</div></div>