1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

Merge commit '061c489895d29049a88dc6118e4b639a273b31d6'

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

Conflicts:
	libavcodec/eamad.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-02-23 21:29:35 +01:00
commit cce8f750d9

View File

@ -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;
}