Commit 70df5111 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/af_dynaudnorm: fix possible null pointer dereference

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 62dfe1d4
...@@ -173,6 +173,7 @@ static cqueue *cqueue_create(int size) ...@@ -173,6 +173,7 @@ static cqueue *cqueue_create(int size)
static void cqueue_free(cqueue *q) static void cqueue_free(cqueue *q)
{ {
if (q)
av_free(q->elements); av_free(q->elements);
av_free(q); av_free(q);
} }
...@@ -684,8 +685,11 @@ static av_cold void uninit(AVFilterContext *ctx) ...@@ -684,8 +685,11 @@ static av_cold void uninit(AVFilterContext *ctx)
av_freep(&s->fade_factors[1]); av_freep(&s->fade_factors[1]);
for (c = 0; c < s->channels; c++) { for (c = 0; c < s->channels; c++) {
if (s->gain_history_original)
cqueue_free(s->gain_history_original[c]); cqueue_free(s->gain_history_original[c]);
if (s->gain_history_minimum)
cqueue_free(s->gain_history_minimum[c]); cqueue_free(s->gain_history_minimum[c]);
if (s->gain_history_smoothed)
cqueue_free(s->gain_history_smoothed[c]); cqueue_free(s->gain_history_smoothed[c]);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment