[FFmpeg-cvslog] avfilter/avf_showfreqs: Fix memleak of out frame

Michael Niedermayer git at videolan.org
Sat Sep 5 16:34:58 CEST 2015


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sat Sep  5 15:35:37 2015 +0200| [8ca97b5e4f470cf24fac5e0599dd63c7af142c22] | committer: Michael Niedermayer

avfilter/avf_showfreqs: Fix memleak of out frame

Fixes CID1322344

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavfilter/avf_showfreqs.c b/libavfilter/avf_showfreqs.c
index 1bbaa92..c00e4d8 100644
--- a/libavfilter/avf_showfreqs.c
+++ b/libavfilter/avf_showfreqs.c
@@ -452,8 +452,10 @@ static int plot_freqs(AVFilterLink *inlink, AVFrame *in)
 #define M(a, b) (sqrt((a) * (a) + (b) * (b)))
 
     colors = av_strdup(s->colors);
-    if (!colors)
+    if (!colors) {
+        av_frame_free(&out);
         return AVERROR(ENOMEM);
+    }
 
     for (ch = 0; ch < s->nb_channels; ch++) {
         uint8_t fg[4] = { 0xff, 0xff, 0xff, 0xff };



More information about the ffmpeg-cvslog mailing list