[FFmpeg-devel,3/7] avcodec/vc1dec: Require res_sprite for wmv3images

Submitted by Michael Niedermayer on Aug. 15, 2019, 9:49 p.m.

Details

Message ID 20190815214915.909-3-michael@niedermayer.cc
State Accepted
Commit 9c6b4004928ef41563b0e913666f8da27fdb2399
Headers show

Commit Message

Michael Niedermayer Aug. 15, 2019, 9:49 p.m.
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>
---
 libavcodec/vc1dec.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Michael Niedermayer Aug. 31, 2019, 4:03 p.m.
On Thu, Aug 15, 2019 at 11:49:11PM +0200, Michael Niedermayer wrote:
> 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>
> ---
>  libavcodec/vc1dec.c | 5 +++++
>  1 file changed, 5 insertions(+)

will apply

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 2636ea701f..c2f8391714 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -455,6 +455,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",