aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/alsdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-01 22:31:45 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-11 20:18:47 +0100
commit56d45271d000893dd4b3f8a9943a66d04954b975 (patch)
tree690e43a4664e72a8078406732f131959e3da1111 /libavcodec/alsdec.c
parent8ba17766a6b30db78c638b9f86b3cc57985d2006 (diff)
downloadffmpeg-56d45271d000893dd4b3f8a9943a66d04954b975.tar.gz
avcodec/bgmc: Check input space in ff_bgmc_decode_init()
Fixes: Infinite loop Fixes: 16608/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5636229827133440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b54031a6e93d1abc7fb2d0263e0f6c4b639e423f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r--libavcodec/alsdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 11bbd38f58..f8d10df8c6 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -821,7 +821,9 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
unsigned int low;
unsigned int value;
- ff_bgmc_decode_init(gb, &high, &low, &value);
+ int ret = ff_bgmc_decode_init(gb, &high, &low, &value);
+ if (ret < 0)
+ return ret;
current_res = bd->raw_samples + start;