aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-03-21 01:38:34 -0300
committerJames Almer <jamrial@gmail.com>2018-03-21 01:38:34 -0300
commit7e0dc7210bed69106632540367544381a565fa4d (patch)
treec8172b9894828c56c6393c92823ffa51f28fa2ed
parent72bb955625e8cf03095a4e53a68daf5ad8e739e4 (diff)
downloadffmpeg-7e0dc7210bed69106632540367544381a565fa4d.tar.gz
avcodec/vp9_superframe_split: fix memory leak in case of output packet creation failure
Some function calls may fail after the output packet is initialized. Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/vp9_superframe_split_bsf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/vp9_superframe_split_bsf.c b/libavcodec/vp9_superframe_split_bsf.c
index 7b6fa38554..9c4aa33dc1 100644
--- a/libavcodec/vp9_superframe_split_bsf.c
+++ b/libavcodec/vp9_superframe_split_bsf.c
@@ -126,6 +126,8 @@ static int vp9_superframe_split_filter(AVBSFContext *ctx, AVPacket *out)
return 0;
fail:
+ if (ret < 0)
+ av_packet_unref(out);
av_packet_unref(&s->buffer_pkt);
return ret;
}