From 3048af835051b4245e51e63204fce72e7c71c8a4 Mon Sep 17 00:00:00 2001 From: Roberto Togni Date: Sat, 15 Jan 2005 00:07:38 +0000 Subject: [PATCH] Use avcodec_check_dimensions instead of custom hack Originally committed as revision 3836 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/8bps.c | 3 +-- libavcodec/lcl.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index 9adf4967c5..5123532d2d 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -160,8 +160,7 @@ static int decode_init(AVCodecContext *avctx) c->pic.data[0] = NULL; - // FIXME: find a better way to prevent integer overflow - if (((unsigned int)avctx->width > 32000) || ((unsigned int)avctx->height > 32000)) { + if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) { av_log(avctx, AV_LOG_ERROR, "Bad image size (w = %d, h = %d).\n", avctx->width, avctx->height); return 1; } diff --git a/libavcodec/lcl.c b/libavcodec/lcl.c index cd2a3a8498..bf04154a91 100644 --- a/libavcodec/lcl.c +++ b/libavcodec/lcl.c @@ -640,9 +640,7 @@ static int decode_init(AVCodecContext *avctx) return 1; } - // FIXME: find a better way to prevent integer overflow - if (((unsigned int)avctx->width > 32000) || ((unsigned int)avctx->height > 32000)) { - av_log(avctx, AV_LOG_ERROR, "Bad image size (w = %d, h = %d).\n", avctx->width, avctx->height); + if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) { return 1; } -- GitLab