[FFmpeg-devel] [PATCH 2/2] avcodec/vc1_block: Fix invalid shifts in vc1_decode_i_blocks()

Michael Niedermayer michael at niedermayer.cc
Thu Jun 27 01:40:58 EEST 2019


On Sat, Jun 22, 2019 at 04:55:47PM +0200, Paul B Mahol wrote:
> On 6/22/19, Michael Niedermayer <michael at niedermayer.cc> wrote:
> > Fixes: left shift of negative value -9
> > Fixes:
> > 15299/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSS2_fuzzer-5660922678345728
> >
> > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  libavcodec/vc1_block.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
> > index 7e41791832..6137252580 100644
> > --- a/libavcodec/vc1_block.c
> > +++ b/libavcodec/vc1_block.c
> > @@ -2600,13 +2600,13 @@ static void vc1_decode_i_blocks(VC1Context *v)
> >                  if (v->rangeredfrm)
> >                      for (k = 0; k < 6; k++)
> >                          for (j = 0; j < 64; j++)
> > -                            v->block[v->cur_blk_idx][block_map[k]][j] <<=
> > 1;
> > +                            v->block[v->cur_blk_idx][block_map[k]][j] *= 2;
> >                  vc1_put_blocks_clamped(v, 1);
> >              } else {
> >                  if (v->rangeredfrm)
> >                      for (k = 0; k < 6; k++)
> >                          for (j = 0; j < 64; j++)
> > -                            v->block[v->cur_blk_idx][block_map[k]][j] =
> > (v->block[v->cur_blk_idx][block_map[k]][j] - 64) << 1;
> > +                            v->block[v->cur_blk_idx][block_map[k]][j] =
> > (v->block[v->cur_blk_idx][block_map[k]][j] - 64) * 2;
> >                  vc1_put_blocks_clamped(v, 0);
> >              }
> >
> > --
> > 2.22.0
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> 
> 
> This is much slower.

please provide your testcase and benchmarks or disassmbly

thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190627/f5411880/attachment.sig>


More information about the ffmpeg-devel mailing list