avfilter/vf_amplify: check if array is availabe before using it

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2018-05-14 16:00:00 +02:00
parent 10ed9f2b12
commit e3a697eda3
1 changed files with 4 additions and 2 deletions

View 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);
}