about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Makefile.version2
-rw-r--r--doc/HISTORY6
-rw-r--r--generator/pbmtext.c6
-rw-r--r--lib/libpbmfont.c2
4 files changed, 13 insertions, 3 deletions
diff --git a/Makefile.version b/Makefile.version
index a95e296a..a7718939 100644
--- a/Makefile.version
+++ b/Makefile.version
@@ -1,4 +1,4 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 42
-NETPBM_POINT_RELEASE = 2
+NETPBM_POINT_RELEASE = 3
 
diff --git a/doc/HISTORY b/doc/HISTORY
index 16549ba8..6ad28f08 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,12 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+08.05.10 BJH  Release 10.42.03
+
+              pbmtext: fail properly if input contains no text.
+
+              pbm_loadbdffont(): handle zero size glyph.  Affects pbmtext.
+
 08.04.09 BJH  Release 10.42.02
 
               pnmnorm: fix resolution of conflicting -wpercent and -wvalue.
diff --git a/generator/pbmtext.c b/generator/pbmtext.c
index 251f051a..40423db9 100644
--- a/generator/pbmtext.c
+++ b/generator/pbmtext.c
@@ -823,7 +823,11 @@ main(int argc, char *argv[]) {
 
     computeImageWidth(formattedText, fontP, cmdline.space, hmargin,
                       &cols, &maxleftb);
-                        
+
+    if (cols == 0 || rows == 0)
+        pm_error("Input is all whitespace and/or non-renderable characters.  "
+                 "No output.");
+
     bits = pbm_allocarray(cols, rows);
 
     /* Fill background with white */
diff --git a/lib/libpbmfont.c b/lib/libpbmfont.c
index 708205a2..902eaf0d 100644
--- a/lib/libpbmfont.c
+++ b/lib/libpbmfont.c
@@ -1187,7 +1187,7 @@ createBmap(unsigned int  const glyphWidth,
     unsigned char * bmap;
     int rc;
 
-    if (UINT_MAX / glyphWidth < glyphHeight)
+    if (glyphWidth > 0 && UINT_MAX / glyphWidth < glyphHeight)
         pm_error("Ridiculously large glyph");
 
     MALLOCARRAY(bmap, glyphWidth * glyphHeight);