Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-09 02:23:49 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-06 13:30:42 +0300
commit95e414dc5dd3c1500bd531eaa886f27cd84640f3 (patch)
tree2fb8aff37b6c8eddf121677e2cccc5f6b85acb72 /libavcodec/alac.c
parentd0563bdf5f5ed050fa65e022e807449698a4a113 (diff)
avcodec/alac: Check for bps of 0
Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int' Fixes: 15764/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5102101203517440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 8f49176e845fee8e4e0aaf06411636b46d1ae3ad) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r--libavcodec/alac.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index e06bb14e34..af486abf84 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -250,10 +250,12 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
alac->extra_bits = get_bits(&alac->gb, 2) << 3;
bps = alac->sample_size - alac->extra_bits + channels - 1;
- if (bps > 32U) {
+ if (bps > 32) {
avpriv_report_missing_feature(avctx, "bps %d", bps);
return AVERROR_PATCHWELCOME;
}
+ if (bps < 1)
+ return AVERROR_INVALIDDATA;
/* whether the frame is compressed */
is_compressed = !get_bits1(&alac->gb);