You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/sanm: Check decoded_size for old_codec48
Fixes: writing over the end of the array
Fixes: BIGSLEEP-434637586/payload
Regression since: b22ce90d42
Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@ -1601,6 +1601,11 @@ static int old_codec48(SANMVideoContext *ctx, int width, int height)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
if (decoded_size > ctx->buf_size) {
|
||||||
|
av_log(ctx->avctx, AV_LOG_ERROR, "Decoded size %u is too large.\n", decoded_size);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
if (rle_decode(ctx, &ctx->gb, dst, decoded_size))
|
if (rle_decode(ctx, &ctx->gb, dst, decoded_size))
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user