From 7ad742b2247a0d6f742a656892b4963fa77744dd Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Sat, 6 Dec 2014 16:57:23 +0100
Subject: [PATCH] avfilter/vf_signalstats: fix avframe leak on error

Fixes CID1257014
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
 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 4b2792f1171..8632761cc30 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;
 }
-- 
GitLab