OSDN Git Service

Merge commit '6255ccf7d51c82ab79bf0cd47a921f572dda4489'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 14 Jul 2013 10:42:23 +0000 (12:42 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 14 Jul 2013 10:43:45 +0000 (12:43 +0200)
* commit '6255ccf7d51c82ab79bf0cd47a921f572dda4489':
  indeo4: Check the quantization matrix index

Conflicts:
libavcodec/indeo4.c

See: 8a20774a24bb1ea68b7360113746eac6e59ad8a8

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

@@@ -371,24 -359,11 +371,25 @@@ static int decode_band_hdr(IVI45DecCont
                  av_log(avctx, AV_LOG_ERROR, "Custom quant matrix encountered!\n");
                  return AVERROR_INVALIDDATA;
              }
-             if (quant_mat > 21) {
-                 av_log(avctx, AV_LOG_ERROR, "Invalid quant matrix encountered!\n");
 -            if (band->quant_mat >= FF_ARRAY_ELEMS(quant_index_to_tab)) {
++            if (quant_mat >= FF_ARRAY_ELEMS(quant_index_to_tab)) {
+                 avpriv_request_sample(avctx, "Quantization matrix %d",
 -                                      band->quant_mat);
++                                      quant_mat);
                  return AVERROR_INVALIDDATA;
              }
 +            band->quant_mat = quant_mat;
 +        }
 +        if (quant_index_to_tab[band->quant_mat] > 4 && band->blk_size == 4) {
 +            av_log(avctx, AV_LOG_ERROR, "Invalid quant matrix for 4x4 block encountered!\n");
 +            band->quant_mat = 0;
 +            return AVERROR_INVALIDDATA;
 +        }
 +        if (band->scan_size != band->blk_size) {
 +            av_log(avctx, AV_LOG_ERROR, "mismatching scan table!\n");
 +            return AVERROR_INVALIDDATA;
 +        }
 +        if (band->transform_size == 8 && band->blk_size < 8) {
 +            av_log(avctx, AV_LOG_ERROR, "mismatching transform_size!\n");
 +            return AVERROR_INVALIDDATA;
          }
  
          /* decode block huffman codebook */