OSDN Git Service

avcodec/utils: fix memleak on avcodec_open2() failure
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 23 Dec 2013 00:53:05 +0000 (01:53 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 23 Dec 2013 00:54:13 +0000 (01:54 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/utils.c

index b8a8d47..c000d27 100644 (file)
@@ -1477,8 +1477,10 @@ end:
 free_and_end:
     av_dict_free(&tmp);
     av_freep(&avctx->priv_data);
-    if (avctx->internal)
+    if (avctx->internal) {
         av_freep(&avctx->internal->pool);
+        av_frame_free(&avctx->internal->to_free);
+    }
     av_freep(&avctx->internal);
     avctx->codec = NULL;
     goto end;