From 17d018d54f9df84ef4a1b3624696bb231e590b93 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 10 May 2008 18:58:29 +0000 Subject: handle empty input git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@618 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- generator/pbmtext.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 */ -- cgit 1.4.1