Merge commit '06c52faef27e5bded4ceda7e6d1541f9fb20e84c' into release/0.10

* commit '06c52faef27e5bded4ceda7e6d1541f9fb20e84c':
  indeo4: Check the quantization matrix index
  indeo4: Do not access missing reference MV

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-09-25 22:30:06 +02:00
commit 91ad27e8f5

View File

@ -361,6 +361,11 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
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)) {
av_log_ask_for_sample(avctx, "Quantization matrix %d",
band->quant_mat);
return AVERROR_INVALIDDATA;
}
}
/* decode block huffman codebook */
@ -463,7 +468,7 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
}
mb->mv_x = mb->mv_y = 0; /* no motion vector coded */
if (band->inherit_mv) {
if (band->inherit_mv && ref_mb) {
/* motion vector inheritance */
if (mv_scale) {
mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
@ -475,7 +480,10 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
}
} else {
if (band->inherit_mv) {
mb->type = ref_mb->type; /* copy mb_type from corresponding reference mb */
/* copy mb_type from corresponding reference mb */
if (!ref_mb)
return AVERROR_INVALIDDATA;
mb->type = ref_mb->type;
} else if (ctx->frame_type == FRAMETYPE_INTRA) {
mb->type = 0; /* mb_type is always INTRA for intra-frames */
} else {
@ -498,6 +506,7 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
mb->mv_x = mb->mv_y = 0; /* there is no motion vector in intra-macroblocks */
} else {
if (band->inherit_mv) {
if (ref_mb)
/* motion vector inheritance */
if (mv_scale) {
mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);