Commit cce8f750 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '061c4898'

* commit '061c4898':
  eamad: check for out of bounds read

Conflicts:
	libavcodec/eamad.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 92ec3470 061c4898
......@@ -151,6 +151,11 @@ static inline int decode_block_intra(MadContext *s, int16_t * block)
break;
} else if (level != 0) {
i += run;
if (i > 63) {
av_log(s->avctx, AV_LOG_ERROR,
"ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
j = scantable[i];
level = (level*quant_matrix[j]) >> 4;
level = (level-1)|1;
......@@ -165,6 +170,11 @@ static inline int decode_block_intra(MadContext *s, int16_t * block)
run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
i += run;
if (i > 63) {
av_log(s->avctx, AV_LOG_ERROR,
"ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
j = scantable[i];
if (level < 0) {
level = -level;
......@@ -176,10 +186,6 @@ static inline int decode_block_intra(MadContext *s, int16_t * block)
level = (level-1)|1;
}
}
if (i > 63) {
av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
block[j] = level;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment