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

Submitted by Michael Niedermayer on Oct. 31, 2019, 5:58 p.m.

Details

Message ID 20191031175830.24895-2-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer Oct. 31, 2019, 5:58 p.m.
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@niedermayer.cc>
---
 libavcodec/wmadec.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

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;