]> git.sesse.net Git - ffmpeg/commitdiff
Use avcodec_check_dimensions instead of custom hack
authorRoberto Togni <r_togni@tiscali.it>
Sat, 15 Jan 2005 00:07:38 +0000 (00:07 +0000)
committerRoberto Togni <r_togni@tiscali.it>
Sat, 15 Jan 2005 00:07:38 +0000 (00:07 +0000)
Originally committed as revision 3836 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/8bps.c
libavcodec/lcl.c

index 9adf4967c5ccd3f3e65ecd67a82cbf785906157b..5123532d2d9c5aa97c5c70bc7f72e3ae4d41f889 100644 (file)
@@ -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;
     }
index cd2a3a849881ec19049ad11bc4db01134e5396ad..bf04154a91b8b7a425843952faf5dba0f9876f11 100644 (file)
@@ -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;
     }