Browse Source

avcodec/sonic: Check channels before deallocating

Fixes: heap-buffer-overflow
Fixes: 25744/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5172961169113088

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f249981976)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.3.2
Michael Niedermayer 5 years ago
parent
commit
e652893c04
1 changed files with 1 additions and 3 deletions
  1. +1
    -3
      libavcodec/sonic.c

+ 1
- 3
libavcodec/sonic.c View File

@@ -980,9 +980,7 @@ static av_cold int sonic_decode_close(AVCodecContext *avctx)
av_freep(&s->int_samples);
av_freep(&s->tap_quant);
av_freep(&s->predictor_k);

for (i = 0; i < s->channels; i++)
{
for (i = 0; i < MAX_CHANNELS; i++) {
av_freep(&s->predictor_state[i]);
av_freep(&s->coded_samples[i]);
}


Loading…
Cancel
Save