From 50079a6aa93291e6dc9d9fb8d33da83f79e9311d Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 16 Dec 2013 22:54:43 +0100 Subject: [PATCH] lavc: do not leak the internal frame if opening the codec fails --- libavcodec/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 1c56d79772..1b29b1b884 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -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;