mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-30 22:00:51 +08:00
avcodec/sanm: enforce SANM min and max sizes at decode_init()
Enforce at least 8x8 and at max 800x600 for SANM/BL16. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
This commit is contained in:
@@ -639,6 +639,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
// ANIM has no dimensions in the header, distrust the incoming data.
|
||||
avctx->width = avctx->height = 0;
|
||||
ctx->have_dimensions = 0;
|
||||
} else if (avctx->width > 800 || avctx->height > 600 ||
|
||||
avctx->width < 8 || avctx->height < 8) {
|
||||
// BL16 valid range is 8x8 - 800x600
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
init_sizes(ctx, avctx->width, avctx->height);
|
||||
if (init_buffers(ctx)) {
|
||||
|
||||
Reference in New Issue
Block a user