[FFmpeg-devel] [PATCH] mjpegdec: ensure SOF before SOS/EOI

Reimar Döffinger Reimar.Doeffinger
Fri Jul 3 15:32:28 CEST 2009

On Wed, Jul 01, 2009 at 08:21:05PM +0000, Jai Menon wrote:
> On Wed, Jul 1, 2009 at 8:15 PM, Reimar
> D?ffinger<Reimar.Doeffinger at gmx.de> wrote:
> > Hello,
> > this fixes issue1240, mjpeg/smclockmjpeg.avi.1.0
> > The problem is, it reaches EOI before SOF, thus get_buffer was
> > never called and the picture it returns has invalid values for
> > data[] (NULL in this case, but it could be values from a previous
> > frame which still would be wrong).
> > This could also happen, if avcodec_check_dimensions failed, which
> > might make this even more of an issue.
> > Attached patch fixes it and also protects the decode_sos part so
> > it will only be called with a valid picture.
> A related patch has been posted where i'm using a similar flag to
> detect valid EOI markers, maybe we could somehow use the same flag.
> Just a thought.

Maybe, but I am sure not going to search for the patch to find out without
getting any hints

More information about the ffmpeg-devel mailing list