aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-12-08 20:18:07 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:49:26 +0200
commit1ef8357feeed124d75ea8c0ca12b97742bea2d70 (patch)
treec4d2742c29c3b913c7acd03d106737ad7ef69a35
parent02a7dd06a7da277cbaef12fc812c4409c7b36609 (diff)
downloadffmpeg-1ef8357feeed124d75ea8c0ca12b97742bea2d70.tar.gz
avcodec/vc1dec: Check field_mode for sprites
Fixes: Out of array read Fixes: 19263/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5389219325542400 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 32fb9198360402941e49aa878b9d33737b654f62) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/vc1dec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index e25a4fa8e8..362f335c34 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -869,7 +869,12 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
ret = AVERROR_INVALIDDATA;
goto err;
}
-
+ if ((avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || avctx->codec_id == AV_CODEC_ID_VC1IMAGE)
+ && v->field_mode) {
+ av_log(v->s.avctx, AV_LOG_ERROR, "Sprite decoder: expected Frames not Fields\n");
+ ret = AVERROR_INVALIDDATA;
+ goto err;
+ }
if ((s->mb_height >> v->field_mode) == 0) {
av_log(v->s.avctx, AV_LOG_ERROR, "image too short\n");
ret = AVERROR_INVALIDDATA;