[FFmpeg-cvslog] avcodec/vp9_superframe_split: fix memory leak in case of output packet creation failure

James Almer git at videolan.org
Wed Mar 21 06:40:16 EET 2018


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed Mar 21 01:38:34 2018 -0300| [7e0dc7210bed69106632540367544381a565fa4d] | committer: James Almer

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 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7e0dc7210bed69106632540367544381a565fa4d
---

 libavcodec/vp9_superframe_split_bsf.c | 2 ++
 1 file changed, 2 insertions(+)

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;
 }



More information about the ffmpeg-cvslog mailing list