sanm: add forgotten check for decoded_size in old_codec37()
Fixes out of array accesses Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
3b1f037df5
commit
365270aec5
@ -417,6 +417,11 @@ static int old_codec37(SANMVideoContext *ctx, int top,
|
|||||||
flags = bytestream2_get_byte(&ctx->gb);
|
flags = bytestream2_get_byte(&ctx->gb);
|
||||||
bytestream2_skip(&ctx->gb, 3);
|
bytestream2_skip(&ctx->gb, 3);
|
||||||
|
|
||||||
|
if (decoded_size > height * stride - left - top * stride) {
|
||||||
|
decoded_size = height * stride - left - top * stride;
|
||||||
|
av_log(ctx->avctx, AV_LOG_WARNING, "decoded size is too large\n");
|
||||||
|
}
|
||||||
|
|
||||||
ctx->rotate_code = 0;
|
ctx->rotate_code = 0;
|
||||||
|
|
||||||
if (((seq & 1) || !(flags & 1)) && (compr && compr != 2))
|
if (((seq & 1) || !(flags & 1)) && (compr && compr != 2))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user