From 643fd8a198ddb67225f5edd503f8f151d13635a3 Mon Sep 17 00:00:00 2001 From: Reimar Döffinger Date: Sat, 4 Jul 2009 18:20:35 +0000 Subject: Add a got_picture flag to MJpegDecodeContext which indicates if its picture element is valid. Skip the code handling SOS and EOI if not, since it can not work without a valid AVPicture. This fixes a crash with mjpeg/smclockmjpeg.avi.1.0 from issue 1240 where the decoder returned an invalid AVPicture. Originally committed as revision 19342 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/mjpegdec.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libavcodec/mjpegdec.h') diff --git a/libavcodec/mjpegdec.h b/libavcodec/mjpegdec.h index 5a77759b3c..9ef8987db3 100644 --- a/libavcodec/mjpegdec.h +++ b/libavcodec/mjpegdec.h @@ -81,6 +81,7 @@ typedef struct MJpegDecodeContext { int quant_index[4]; /* quant table index for each component */ int last_dc[MAX_COMPONENTS]; /* last DEQUANTIZED dc (XXX: am I right to do that ?) */ AVFrame picture; /* picture structure */ + int got_picture; ///< we found a SOF and picture is valid, too. int linesize[MAX_COMPONENTS]; ///< linesize << interlaced int8_t *qscale_table; DECLARE_ALIGNED_16(DCTELEM, block[64]); -- cgit v1.2.3