[Ffmpeg-devel] Incorrect JPEG decoding with patch

Michael Niedermayer michaelni
Mon Nov 20 11:09:55 CET 2006


Hi

On Mon, Nov 20, 2006 at 07:51:15AM +0200, Kostya wrote:
> On Fri, Nov 17, 2006 at 07:34:34PM +0100, Michael Niedermayer wrote:
> > Hi
> > 
> [...]
> > 
> > can the normal mjpeg_decode_scan() with nb_components=1 instead of 3 not
> > be used?
> 
> Yes
> 
> > 
> > > +
> > > +
> > >  static int mjpeg_decode_sos(MJpegDecodeContext *s)
> > >  {
> > >      int len, nb_components, i, h, v, predictor, point_transform;
> > [...]
> > >      /* XXX: only interleaved scan accepted */
> > >      if ((nb_components != s->nb_components) && !s->ls)
> > >      {
> > > -        dprintf("decode_sos: components(%d) mismatch\n", nb_components);
> > > -        return -1;
> > > +        dprintf("decode_sos: multiple scan detected, id of current ");
> > > +        /* return -1; */
> > 
> > if something is wrong remove it, dont comment it out
> > 
> [...]
> 
> Here is my variant for this.
> I had to replace {h,v}_scount[s->comp_index[0]] with {h,v}_scount[0] because with
> this JPEGs s->comp_index[0] == plane index and referenced value is zero.
> It may fail with JPEGs with non-standard plane indexes (i.e. 3,4,5) but I suppose
> that is very exotic case.

patch looks ok


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

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list