]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/avf_showfreqs: Fix memleak of out frame
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 5 Sep 2015 13:35:37 +0000 (15:35 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 5 Sep 2015 13:46:18 +0000 (15:46 +0200)
Fixes CID1322344

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/avf_showfreqs.c

index 1bbaa92a99e4a2fc2069d63fb061d19ad1ff91f3..c00e4d8633808aec3e4f054debd1b7c9aa0ea09b 100644 (file)
@@ -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 };