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

Jai Menon jmenon86
Wed Jul 1 22:21:05 CEST 2009


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.

-- 
Regards,

Jai



More information about the ffmpeg-devel mailing list