OSDN Git Service

lavc: do not leak the internal frame if opening the codec fails
authorAnton Khirnov <anton@khirnov.net>
Mon, 16 Dec 2013 21:54:43 +0000 (22:54 +0100)
committerAnton Khirnov <anton@khirnov.net>
Mon, 6 Jan 2014 07:21:58 +0000 (08:21 +0100)
libavcodec/utils.c

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