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

Michael Niedermayer michael at niedermayer.cc
Sat Oct 19 01:19:24 EEST 2019


Fixes: null pointer dereference
Fixes: 18326/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAV2_fuzzer-5071752362721280

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, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 78b51e5871..a2ea930350 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -822,7 +822,7 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data,
         s->last_superframe_len = 0;
         return 0;
     }
-    if (buf_size < avctx->block_align) {
+    if (buf_size < avctx->block_align || avctx->block_align < 0) {
         av_log(avctx, AV_LOG_ERROR,
                "Input packet size too small (%d < %d)\n",
                buf_size, avctx->block_align);
-- 
2.23.0



More information about the ffmpeg-devel mailing list