]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/dstdec: Check sample rate
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 13 Feb 2020 19:56:56 +0000 (20:56 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 10 May 2020 07:55:57 +0000 (09:55 +0200)
Fixes: out of array access
Fixes: 20659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5735812071424000
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/dstdec.c

index 9feca4b085fea86e7b10eea9255d983e268a8b4c..771887faf9136c770519aa06f3e8c7f2ba2ae91d 100644 (file)
@@ -86,6 +86,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
         return AVERROR_PATCHWELCOME;
     }
 
+    if (DST_SAMPLES_PER_FRAME(avctx->sample_rate) & 7) {
+        return AVERROR_PATCHWELCOME;
+    }
+
     avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
 
     for (i = 0; i < avctx->channels; i++)