lavc: add avcodec_free_frame().
Since an AVFrame now has malloced members (extended_data), it must have a destructor.
This commit is contained in:
@@ -659,6 +659,21 @@ AVFrame *avcodec_alloc_frame(void)
|
||||
return frame;
|
||||
}
|
||||
|
||||
void avcodec_free_frame(AVFrame **frame)
|
||||
{
|
||||
AVFrame *f;
|
||||
|
||||
if (!frame || !*frame)
|
||||
return;
|
||||
|
||||
f = *frame;
|
||||
|
||||
if (f->extended_data != f->data)
|
||||
av_freep(&f->extended_data);
|
||||
|
||||
av_freep(frame);
|
||||
}
|
||||
|
||||
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
|
||||
{
|
||||
int ret = 0;
|
||||
|
Reference in New Issue
Block a user