summaryrefslogtreecommitdiff
path: root/libavcodec/alsdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-04 19:35:15 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-31 19:51:56 +0100
commit59479f474f28368530b88b6a15604b8b7eaaa053 (patch)
tree642e732f5d236e2656b6f83b91fcd77707a5fef4 /libavcodec/alsdec.c
parentf2457bd115f4af51fc0a101f27625ecb37259047 (diff)
downloadffmpeg-59479f474f28368530b88b6a15604b8b7eaaa053.tar.gz
avcodec/alsdec: Check that input space for header exists in read_diff_float_data()
Fixes: Timeout (21sec -> 8sec) Fixes: 17832/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5737092172218368 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 09581f7923ed9af7719762868e8f1ff626ea8374) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r--libavcodec/alsdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 56313d206c..3819307fbf 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1475,6 +1475,9 @@ static int read_diff_float_data(ALSDecContext *ctx, unsigned int ra_frame) {
ff_mlz_flush_dict(ctx->mlz);
}
+ if (avctx->channels * 8 > get_bits_left(gb))
+ return AVERROR_INVALIDDATA;
+
for (c = 0; c < avctx->channels; ++c) {
if (use_acf) {
//acf_flag