OSDN Git Service

Merge commit '0cb83c563848bf8f8365e7bd30e7e6b57ef360f0'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 13 Oct 2013 08:19:15 +0000 (10:19 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 13 Oct 2013 08:19:15 +0000 (10:19 +0200)
* commit '0cb83c563848bf8f8365e7bd30e7e6b57ef360f0':
  indeo4: Check the block size if reusing the band configuration

Conflicts:
libavcodec/indeo4.c

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

@@@ -387,26 -374,19 +388,33 @@@ static int decode_band_hdr(IVI45DecCont
                  av_log(avctx, AV_LOG_ERROR, "Custom quant matrix encountered!\n");
                  return AVERROR_INVALIDDATA;
              }
 -            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;
+         } else {
+             if (old_blk_size != band->blk_size) {
+                 av_log(avctx, AV_LOG_ERROR,
+                        "The band block size does not match the configuration "
+                        "inherited\n");
+                 return AVERROR_INVALIDDATA;
+             }
          }
 +        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 */
          if (!get_bits1(&ctx->gb))