Commit 1ea5bbc5 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 365270ae)
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent f5955d9f
......@@ -416,6 +416,11 @@ static int old_codec37(SANMVideoContext *ctx, int top,
flags = bytestream2_get_byte(&ctx->gb);
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;
if (((seq & 1) || !(flags & 1)) && (compr && compr != 2))
......
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