aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-09-13 21:12:17 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-10-05 21:28:08 +0200
commit6e1af591d5d383178fcdf59051294755d4328948 (patch)
tree42280d47a73b0c0ff1504a6516fdc946f0a08d67
parent105481980265055cbf5bec25508ec44d26fb867e (diff)
downloadffmpeg-6e1af591d5d383178fcdf59051294755d4328948.tar.gz
avcodec/wmalosslessdec: Check remaining space before padding and channel residue
Fixes: Timeout (1101sec -> 0.4sec) Fixes: 24491/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5725337036783616 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 c467adf3bf9bb4b7fd28956ec698d884e63f145d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wmalosslessdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 2228eecd96..5afc0544d5 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -935,6 +935,8 @@ static int decode_subframe(WmallDecodeCtx *s)
s->do_lpc = 0;
}
+ if (get_bits_left(&s->gb) < 1)
+ return AVERROR_INVALIDDATA;
if (get_bits1(&s->gb))
padding_zeroes = get_bits(&s->gb, 5);