ffmpeg: Fix avframe memleak
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 30 Mar 2017 14:13:22 +0000 (16:13 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 30 Mar 2017 14:34:06 +0000 (16:34 +0200)
Fixes CID1401674

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
ffmpeg.c

index 1a0e909..11faf0d 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2176,8 +2176,10 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame)
 
                 if (!av_fifo_space(ifilter->frame_queue)) {
                     ret = av_fifo_realloc2(ifilter->frame_queue, 2 * av_fifo_size(ifilter->frame_queue));
-                    if (ret < 0)
+                    if (ret < 0) {
+                        av_frame_free(&tmp);
                         return ret;
+                    }
                 }
                 av_fifo_generic_write(ifilter->frame_queue, &tmp, sizeof(tmp), NULL);
                 return 0;