Michael Niedermayer <[email protected]> added the comment: On Mon, Feb 23, 2009 at 07:50:51AM +0000, Kostya Shishkov wrote: > Another JPEG format abuse: ILV (aka Se) value is stored as 255 > instead of correct 63 thus causing next value misread. > > This simple patch will fix first plane decoding (making ffmjpeg > decode colour data is less trivial). > > Index: libavcodec/mjpegdec.c > ================================================================ > === > --- libavcodec/mjpegdec.c (revision 16921) > +++ libavcodec/mjpegdec.c (working copy) > @@ -946,8 +946,13 @@ > > predictor= get_bits(&s->gb, 8); /* JPEG Ss / lossless JPEG > predictor /JPEG-LS NEAR */ > ilv= get_bits(&s->gb, 8); /* JPEG Se / JPEG-LS ILV */ > + if(ilv != 255){ > prev_shift = get_bits(&s->gb, 4); /* Ah */ > point_transform= get_bits(&s->gb, 4); /* Al */ > + }else{ > + prev_shift = 0; > + point_transform = 0; > + }
could this be a problem with escaping? 255 being the byte that is escaped .. [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If a bugfix only changes things apparently unrelated to the bug with no further explanation, that is a good sign that the bugfix is wrong. ____________________________________________________ FFmpeg issue tracker <[email protected]> <https://roundup.ffmpeg.org/roundup/ffmpeg/issue777> ____________________________________________________
