Commit d33414d2 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/utils: Check bits_per_coded_sample

This avoids the need for each decoder separately having to handle this case

Fixes: shift exponent -100663046 is negative
Fixes: out of array access
Fixes: 15270/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5727829913763840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 247a1de7
...@@ -962,6 +962,10 @@ FF_ENABLE_DEPRECATION_WARNINGS ...@@ -962,6 +962,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
ret = AVERROR(EINVAL); ret = AVERROR(EINVAL);
goto free_and_end; goto free_and_end;
} }
if (avctx->bits_per_coded_sample < 0) {
ret = AVERROR(EINVAL);
goto free_and_end;
}
if (avctx->sub_charenc) { if (avctx->sub_charenc) {
if (avctx->codec_type != AVMEDIA_TYPE_SUBTITLE) { if (avctx->codec_type != AVMEDIA_TYPE_SUBTITLE) {
av_log(avctx, AV_LOG_ERROR, "Character encoding is only " av_log(avctx, AV_LOG_ERROR, "Character encoding is only "
......
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