avfilter/vf_amplify: check if array is availabe before using it
authorPaul B Mahol <onemda@gmail.com>
Mon, 14 May 2018 14:00:00 +0000 (16:00 +0200)
committerPaul B Mahol <onemda@gmail.com>
Mon, 14 May 2018 14:04:33 +0000 (16:04 +0200)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/vf_amplify.c

index 7b58db0..d1e105e 100644 (file)
@@ -227,8 +227,10 @@ static av_cold void uninit(AVFilterContext *ctx)
     AmplifyContext *s = ctx->priv;
     int i;
 
-    for (i = 0; i < s->nb_frames; i++)
-        av_frame_free(&s->frames[i]);
+    if (s->frames) {
+        for (i = 0; i < s->nb_frames; i++)
+           av_frame_free(&s->frames[i]);
+    }
     av_freep(&s->frames);
 }