about summary refs log tree commit diff
path: root/converter/pbm/pbmtoppa/pbm.c
diff options
context:
space:
mode:
Diffstat (limited to 'converter/pbm/pbmtoppa/pbm.c')
-rw-r--r--converter/pbm/pbmtoppa/pbm.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/converter/pbm/pbmtoppa/pbm.c b/converter/pbm/pbmtoppa/pbm.c
index ae36e0d2..403ca95c 100644
--- a/converter/pbm/pbmtoppa/pbm.c
+++ b/converter/pbm/pbmtoppa/pbm.c
@@ -15,8 +15,11 @@
 
 #include "pm.h"
 #include "nstring.h"
+
 #include "ppapbm.h"
 
+
+
 int
 make_pbm_stat(pbm_stat * const pbmStatP,
               FILE *     const ifP) {
@@ -61,15 +64,15 @@ make_pbm_stat(pbm_stat * const pbmStatP,
                     if (pbmStatP->width < 0) {
                         pm_message("Image has negative width");
                         retval = 0;
-                    } else if (pbmStatP->width > INT_MAX/2) {
-                        pm_message("Uncomputeably large width: %d",
+                    } else if (pbmStatP->width > INT_MAX/2 - 10) {
+                        pm_message("Uncomputably large width: %d",
                                    pbmStatP->width);
                         retval = 0;
                     } else if (pbmStatP->height < 0) {
                         pm_message("Image has negative height");
                         retval = 0;
-                    } else if (pbmStatP->height > INT_MAX/2) {
-                        pm_message("Uncomputeably large height: %d",
+                    } else if (pbmStatP->height > INT_MAX/2 - 10) {
+                        pm_message("Uncomputably large height: %d",
                                    pbmStatP->height);
                         retval = 0;
                     } else
@@ -193,3 +196,4 @@ pbm_unreadline(pbm_stat * const pbmStatP,
 }
 
 
+