aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-15 20:04:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-15 12:25:45 +0100
commitbefb2f717b64a99ea0e8d94c8e482306ae389edc (patch)
treeb96d725907498ac1bcad07af9f924de7d204bca1
parent29765b3be363df5ff0b6d5cb7400fdf3aa101b71 (diff)
downloadffmpeg-befb2f717b64a99ea0e8d94c8e482306ae389edc.tar.gz
avcodec/vc1dec: Require res_sprite for wmv3images
non res_sprite leads to decoder delay which leads to assertion failure Fixes: Assertion failure Fixes: 16402/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3IMAGE_fuzzer-5704510034411520 Fixes: left shift of 1073741824 by 1 places cannot be represented in type 'int' Fixes: 16425/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3IMAGE_fuzzer-5692858838810624 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 9c6b4004928ef41563b0e913666f8da27fdb2399) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/vc1dec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 16c601e756..dbdd5a8857 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -450,6 +450,11 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
if ((ret = ff_vc1_decode_sequence_header(avctx, v, &gb)) < 0)
return ret;
+ if (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE && !v->res_sprite) {
+ avpriv_request_sample(avctx, "Non sprite WMV3IMAGE");
+ return AVERROR_PATCHWELCOME;
+ }
+
count = avctx->extradata_size*8 - get_bits_count(&gb);
if (count > 0) {
av_log(avctx, AV_LOG_INFO, "Extra data: %i bits left, value: %X\n",