changeset 2429:4b350cc506a7 libavcodec

Use avcodec_check_dimensions instead of custom hack
author rtognimp
date Sat, 15 Jan 2005 00:07:38 +0000
parents 548c87c06dbb
children 805cbcf4dc8a
files 8bps.c lcl.c
diffstat 2 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/8bps.c	Fri Jan 14 23:48:12 2005 +0000
+++ b/8bps.c	Sat Jan 15 00:07:38 2005 +0000
@@ -160,8 +160,7 @@
 
 	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;
     }
--- a/lcl.c	Fri Jan 14 23:48:12 2005 +0000
+++ b/lcl.c	Sat Jan 15 00:07:38 2005 +0000
@@ -640,9 +640,7 @@
         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;
     }