$OpenBSD: patch-pbm_mgrtopbm_c,v 1.1 2003/03/29 04:13:54 brad Exp $
--- pbm/mgrtopbm.c.orig	Thu Mar  2 20:02:09 2000
+++ pbm/mgrtopbm.c	Fri Mar 28 20:22:06 2003
@@ -108,6 +108,12 @@ getinit( file, colsP, rowsP, depthP, pad
                  head.magic[0], head.magic[1] );
         pad = -1;  /* should never reach here */
     }
+    
+    if(head.h_wide < ' ' || head.l_wide < ' ')
+    	pm_error("bad width/height chars in MGR file");
+    
+    overflow_add(*colsP, pad);
+    
     *colsP = ( ( (int) head.h_wide - ' ' ) << 6 ) + ( (int) head.l_wide - ' ' );
     *rowsP = ( ( (int) head.h_high - ' ' ) << 6 ) + ( (int) head.l_high - ' ' );
     *padrightP = ( ( *colsP + pad - 1 ) / pad ) * pad - *colsP;
