You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
Merge commit '161442ff2c4b0dd8a5072c6bbe6bf55303fffccf'
* commit '161442ff2c4b0dd8a5072c6bbe6bf55303fffccf': mdec: check for out of bounds read Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -89,6 +89,11 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n)
|
|||||||
break;
|
break;
|
||||||
} else if (level != 0) {
|
} else if (level != 0) {
|
||||||
i += run;
|
i += run;
|
||||||
|
if (i > 63) {
|
||||||
|
av_log(a->avctx, AV_LOG_ERROR,
|
||||||
|
"ac-tex damaged at %d %d\n", a->mb_x, a->mb_y);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
j = scantable[i];
|
j = scantable[i];
|
||||||
level = (level * qscale * quant_matrix[j]) >> 3;
|
level = (level * qscale * quant_matrix[j]) >> 3;
|
||||||
level = (level ^ SHOW_SBITS(re, &a->gb, 1)) - SHOW_SBITS(re, &a->gb, 1);
|
level = (level ^ SHOW_SBITS(re, &a->gb, 1)) - SHOW_SBITS(re, &a->gb, 1);
|
||||||
@@ -99,6 +104,11 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n)
|
|||||||
UPDATE_CACHE(re, &a->gb);
|
UPDATE_CACHE(re, &a->gb);
|
||||||
level = SHOW_SBITS(re, &a->gb, 10); SKIP_BITS(re, &a->gb, 10);
|
level = SHOW_SBITS(re, &a->gb, 10); SKIP_BITS(re, &a->gb, 10);
|
||||||
i += run;
|
i += run;
|
||||||
|
if (i > 63) {
|
||||||
|
av_log(a->avctx, AV_LOG_ERROR,
|
||||||
|
"ac-tex damaged at %d %d\n", a->mb_x, a->mb_y);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
j = scantable[i];
|
j = scantable[i];
|
||||||
if (level < 0) {
|
if (level < 0) {
|
||||||
level = -level;
|
level = -level;
|
||||||
@@ -110,10 +120,6 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n)
|
|||||||
level = (level - 1) | 1;
|
level = (level - 1) | 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i > 63) {
|
|
||||||
av_log(a->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", a->mb_x, a->mb_y);
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
}
|
|
||||||
|
|
||||||
block[j] = level;
|
block[j] = level;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user