[FFmpeg-cvslog] avcodec/utils: Check block_align
Michael Niedermayer
git at videolan.org
Fri Nov 1 21:00:29 EET 2019
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Oct 31 09:31:22 2019 +0100| [f011572e66c8dd2f0ac3cb147a769e91f24e0202] | committer: Michael Niedermayer
avcodec/utils: Check block_align
Fixes: out of array access
Fixes: 18432/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAV2_fuzzer-5675574936207360
Fixes: 18326/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAV2_fuzzer-5071752362721280
Fixes: 18384/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAV1_fuzzer-5769439500304384
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f011572e66c8dd2f0ac3cb147a769e91f24e0202
---
libavcodec/utils.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 6cc770b1ea..75e7035b8a 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -694,6 +694,11 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
ret = AVERROR(EINVAL);
goto free_and_end;
}
+ if (avctx->block_align < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid block align: %d\n", avctx->block_align);
+ ret = AVERROR(EINVAL);
+ goto free_and_end;
+ }
avctx->codec = codec;
if ((avctx->codec_type == AVMEDIA_TYPE_UNKNOWN || avctx->codec_type == codec->type) &&
More information about the ffmpeg-cvslog
mailing list