[FFmpeg-cvslog] avfilter/vf_signalstats: fix avframe leak on error

Michael Niedermayer git at videolan.org
Sat Dec 6 17:06:50 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Dec  6 16:57:23 2014 +0100| [7ad742b2247a0d6f742a656892b4963fa77744dd] | committer: Michael Niedermayer

avfilter/vf_signalstats: fix avframe leak on error

Fixes CID1257014
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavfilter/vf_signalstats.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_signalstats.c b/libavfilter/vf_signalstats.c
index 4b2792f..8632761 100644
--- a/libavfilter/vf_signalstats.c
+++ b/libavfilter/vf_signalstats.c
@@ -132,8 +132,10 @@ static AVFrame *alloc_frame(enum AVPixelFormat pixfmt, int w, int h)
     frame->width  = w;
     frame->height = h;
 
-    if (av_frame_get_buffer(frame, 32) < 0)
+    if (av_frame_get_buffer(frame, 32) < 0) {
+        av_frame_free(&frame);
         return NULL;
+    }
 
     return frame;
 }



More information about the ffmpeg-cvslog mailing list