[FFmpeg-devel] [PATCH] mjpegdec: ensure SOF before SOS/EOI
Fri Jul 3 15:38:15 CEST 2009
On Fri, Jul 3, 2009 at 1:32 PM, Reimar
D?ffinger<Reimar.Doeffinger at gmx.de> wrote:
> 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
Sorry, my bad. Patch can be found at . Again, I'm not 100% sure, so
if you find it irrelevant, please disregard.
More information about the ffmpeg-devel