]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/alsdec: Check that input space for header exists in read_diff_float_data()
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 4 Oct 2019 17:35:15 +0000 (19:35 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 20 Oct 2019 17:57:51 +0000 (19:57 +0200)
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>
libavcodec/alsdec.c

index fafc3a757be25549ca57c1036c4e9d8138bc55a0..4bc0e2bd848669d4f9f62f0e7db7f2187269d333 100644 (file)
@@ -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