[FFmpeg-devel,1/3] avcodec/vc1_block: Fix invalid shift with rangeredfrm

Submitted by Michael Niedermayer on Sept. 11, 2019, 12:18 a.m.

Details

Message ID 20190911001843.2680-1-michael@niedermayer.cc
State Accepted
Commit c722a69253a280b86b1d2a4ca00c89345a796781
Headers show

Commit Message

Michael Niedermayer Sept. 11, 2019, 12:18 a.m.
Fixes: left shift of negative value -7
Fixes: 16959/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3_fuzzer-5200360825683968

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/vc1_block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Sept. 28, 2019, 5:21 p.m.
On Wed, Sep 11, 2019 at 02:18:41AM +0200, Michael Niedermayer wrote:
> Fixes: left shift of negative value -7
> Fixes: 16959/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3_fuzzer-5200360825683968
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/vc1_block.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply patchset

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index 514206f6d2..fe7dbf8b1d 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -1997,7 +1997,7 @@  static int vc1_decode_b_mb(VC1Context *v)
             v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
             if (v->rangeredfrm)
                 for (j = 0; j < 64; j++)
-                    s->block[i][j] <<= 1;
+                    s->block[i][j] *= 2;
             s->idsp.put_signed_pixels_clamped(s->block[i],
                                               s->dest[dst_idx] + off,
                                               i & 4 ? s->uvlinesize