From 23e27a360e47b7c7825f3df22c6013d5066829e3 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 21 Mar 2022 00:30:53 +0100 Subject: avcodec/mlpdec: Use 64bit for channel layout Fixes: shift exponent 33 is too large for 32-bit type 'int' Fixes: 45645/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEHD_fuzzer-5651350182035456 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: James Almer Signed-off-by: Michael Niedermayer --- libavcodec/mlpdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index e3fbaa62c7..5a4d272f78 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -208,7 +208,7 @@ static enum AVChannel thd_channel_layout_extract_channel(uint64_t channel_layout return AV_CHAN_NONE; for (i = 0; i < FF_ARRAY_ELEMS(thd_channel_order); i++) - if (channel_layout & (1 << thd_channel_order[i]) && !index--) + if (channel_layout & (1ULL << thd_channel_order[i]) && !index--) return thd_channel_order[i]; return AV_CHAN_NONE; } -- cgit v1.2.3