[FFmpeg-devel] [PATCH 2/8] avcodec/wmadec: Check block_align

Michael Niedermayer michael at niedermayer.cc
Thu Oct 31 19:58:24 EET 2019


Fixes: out of array access
Fixes: 18432/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAV2_fuzzer-5675574936207360

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/wmadec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 78b51e5871..25c1d9a452 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -828,6 +828,8 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data,
                buf_size, avctx->block_align);
         return AVERROR_INVALIDDATA;
     }
+    if (avctx->block_align < 0)
+        return AVERROR_INVALIDDATA;
     if (avctx->block_align)
         buf_size = avctx->block_align;
 
-- 
2.23.0



More information about the ffmpeg-devel mailing list