avfilter/avf_showfreqs: fix possible null pointer dereference
authorPaul B Mahol <onemda@gmail.com>
Fri, 8 Jan 2016 13:56:15 +0000 (14:56 +0100)
committerPaul B Mahol <onemda@gmail.com>
Fri, 8 Jan 2016 13:58:43 +0000 (14:58 +0100)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/avf_showfreqs.c

index 1b1f441..311dd47 100644 (file)
@@ -459,8 +459,10 @@ static av_cold void uninit(AVFilterContext *ctx)
 
     av_fft_end(s->fft);
     for (i = 0; i < s->nb_channels; i++) {
-        av_freep(&s->fft_data[i]);
-        av_freep(&s->avg_data[i]);
+        if (s->fft_data)
+            av_freep(&s->fft_data[i]);
+        if (s->avg_data)
+            av_freep(&s->avg_data[i]);
     }
     av_freep(&s->fft_data);
     av_freep(&s->avg_data);