mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-05 06:50:27 +00: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:
parent
70b04717d0
commit
556cef27d9
1 changed files with 4 additions and 0 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue