flashsv2enc: fix division by zero

Fixes other half of Ticket1105

Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-05-12 12:03:47 +02:00
parent 40d8c89cb6
commit 2a37ac042f
1 changed files with 5 additions and 0 deletions

View File

@ -192,6 +192,11 @@ static av_cold int flashsv2_encode_init(AVCodecContext * avctx)
"Input dimensions too large, input must be max 4096x4096 !\n"); "Input dimensions too large, input must be max 4096x4096 !\n");
return -1; return -1;
} }
if ((avctx->width < 16) || (avctx->height < 16)) {
av_log(avctx, AV_LOG_ERROR,
"Input dimensions too small, input must be max 16x16 !\n");
return -1;
}
if (av_image_check_size(avctx->width, avctx->height, 0, avctx) < 0) if (av_image_check_size(avctx->width, avctx->height, 0, avctx) < 0)
return -1; return -1;