Mercurial > libavcodec.hg
diff mjpegdec.h @ 9913:b73796e93571 libavcodec
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.
author | reimar |
---|---|
date | Sat, 04 Jul 2009 18:20:35 +0000 |
parents | 0dce4fe6e6f3 |
children | 710e226783f0 |
line wrap: on
line diff
--- a/mjpegdec.h Sat Jul 04 12:54:36 2009 +0000 +++ b/mjpegdec.h Sat Jul 04 18:20:35 2009 +0000 @@ -81,6 +81,7 @@ 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]);