summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index c2e16c4ada..0e4048ec6e 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -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;