comparison 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
comparison
equal deleted inserted replaced
9912:9502108caadf 9913:b73796e93571
79 int v_scount[MAX_COMPONENTS]; 79 int v_scount[MAX_COMPONENTS];
80 int h_max, v_max; /* maximum h and v counts */ 80 int h_max, v_max; /* maximum h and v counts */
81 int quant_index[4]; /* quant table index for each component */ 81 int quant_index[4]; /* quant table index for each component */
82 int last_dc[MAX_COMPONENTS]; /* last DEQUANTIZED dc (XXX: am I right to do that ?) */ 82 int last_dc[MAX_COMPONENTS]; /* last DEQUANTIZED dc (XXX: am I right to do that ?) */
83 AVFrame picture; /* picture structure */ 83 AVFrame picture; /* picture structure */
84 int got_picture; ///< we found a SOF and picture is valid, too.
84 int linesize[MAX_COMPONENTS]; ///< linesize << interlaced 85 int linesize[MAX_COMPONENTS]; ///< linesize << interlaced
85 int8_t *qscale_table; 86 int8_t *qscale_table;
86 DECLARE_ALIGNED_16(DCTELEM, block[64]); 87 DECLARE_ALIGNED_16(DCTELEM, block[64]);
87 DCTELEM (*blocks[MAX_COMPONENTS])[64]; ///< intermediate sums (progressive mode) 88 DCTELEM (*blocks[MAX_COMPONENTS])[64]; ///< intermediate sums (progressive mode)
88 uint8_t *last_nnz[MAX_COMPONENTS]; 89 uint8_t *last_nnz[MAX_COMPONENTS];