[FFmpeg-cvslog] avcodec/mjpegdec: Fix undefined shift

Michael Niedermayer michaelni at gmx.at
Mon Apr 28 00:19:36 CEST 2014


On Sun, Apr 27, 2014 at 07:29:28AM +0200, Reimar Döffinger wrote:
> On 27.04.2014, at 05:45, git at videolan.org (Michael Niedermayer) wrote:
> > ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Apr 27 05:32:56 2014 +0200| [b4329605289e25bb071ec1c1182bf25fc83b09aa] | committer: Michael Niedermayer
> > 
> > avcodec/mjpegdec: Fix undefined shift
> > 
> > Fixes CID1194388
> > 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > 
> >> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b4329605289e25bb071ec1c1182bf25fc83b09aa
> > ---
> > 
> > libavcodec/mjpegdec.c |    2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> > index f2f5498..df1ce1e 100644
> > --- a/libavcodec/mjpegdec.c
> > +++ b/libavcodec/mjpegdec.c
> > @@ -1272,7 +1272,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
> >     }
> > 
> >     if (!Al) {
> > -        s->coefs_finished[c] |= (1LL << (se + 1)) - (1LL << ss);
> > +        s->coefs_finished[c] |= (2LL << se) - (1LL << ss);
> 
> Is that actually fully fixed then?
> Isn't the shift already undefined if shifting into the sign bit, which would happen still for exactly the same values? (though in contrast to shifting by 64 it would probably still work normally)
> (I admit I didn't look at the surrounding code, and I agree with the change anyway since I consider it more readable)

locally fixed

thx

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

Avoid a single point of failure, be that a person or equipment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20140428/96800abe/attachment.asc>


More information about the ffmpeg-cvslog mailing list