diff options
author | Paul B Mahol <onemda@gmail.com> | 2016-01-14 14:27:01 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2016-01-14 14:30:36 +0100 |
commit | 70df51112ccc8d281cdb96141f20b3fd8a5b11f8 (patch) | |
tree | ab42d848a4f6f6f685360a06e3927cb7230a2c39 /libavfilter | |
parent | 62dfe1d40d87f8f67cd77d4b769b7c6163083c5e (diff) | |
download | ffmpeg-70df51112ccc8d281cdb96141f20b3fd8a5b11f8.tar.gz |
avfilter/af_dynaudnorm: fix possible null pointer dereference
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_dynaudnorm.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c index 1a5fc48dab..d0bb51d789 100644 --- a/libavfilter/af_dynaudnorm.c +++ b/libavfilter/af_dynaudnorm.c @@ -173,7 +173,8 @@ static cqueue *cqueue_create(int size) static void cqueue_free(cqueue *q) { - av_free(q->elements); + if (q) + av_free(q->elements); av_free(q); } @@ -684,9 +685,12 @@ static av_cold void uninit(AVFilterContext *ctx) av_freep(&s->fade_factors[1]); for (c = 0; c < s->channels; c++) { - cqueue_free(s->gain_history_original[c]); - cqueue_free(s->gain_history_minimum[c]); - cqueue_free(s->gain_history_smoothed[c]); + if (s->gain_history_original) + cqueue_free(s->gain_history_original[c]); + if (s->gain_history_minimum) + cqueue_free(s->gain_history_minimum[c]); + if (s->gain_history_smoothed) + cqueue_free(s->gain_history_smoothed[c]); } av_freep(&s->gain_history_original); |