Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 14 Dec 2012 14:57:53 +0000 (15:57 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 14 Dec 2012 15:05:12 +0000 (16:05 +0100)
* qatar/master:
  ivi_common: check that scan pattern is set before using it.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ivi_common.c

index 677c33d..504f60f 100644 (file)
@@ -467,6 +467,11 @@ static int ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile
             }
 
             if (cbp & 1) { /* block coded ? */
+                if (!band->scan) {
+                    av_log(avctx, AV_LOG_ERROR, "Scan pattern is not set.\n");
+                    return AVERROR_INVALIDDATA;
+                }
+
                 scan_pos = -1;
                 memset(trvec, 0, num_coeffs*sizeof(trvec[0])); /* zero transform vector */
                 memset(col_flags, 0, sizeof(col_flags));      /* zero column flags */