Browse Source

avcodec/ac3dec: Check that the number of channels with dependant streams is valid

Fixes: left shift of 1 by 63 places cannot be represented in type 'long long'
Fixes: out of array access
Fixes: 7284/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5767914968842240

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e3275f937d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.0.1
Michael Niedermayer 7 years ago
parent
commit
7b7c582c15
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/ac3dec.c

+ 5
- 0
libavcodec/ac3dec.c View File

@@ -1702,6 +1702,11 @@ dependent_frame:
channel_layout |= custom_channel_map_locations[ch][1];
}
}
if (av_get_channel_layout_nb_channels(channel_layout) > EAC3_MAX_CHANNELS) {
av_log(avctx, AV_LOG_ERROR, "Too many channels (%d) coded\n",
av_get_channel_layout_nb_channels(channel_layout));
return AVERROR_INVALIDDATA;
}

avctx->channel_layout = channel_layout;
avctx->channels = av_get_channel_layout_nb_channels(channel_layout);


Loading…
Cancel
Save