about summary refs log tree commit diff
path: root/generator
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-11-06 00:56:08 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-11-06 00:56:08 +0000
commit38243fe783f754d9723f23b797f1b9eda2ba429f (patch)
tree68677587d4a33dc54836eee10b2638cd917296c0 /generator
parente07d96700df08e67b2377e2bd1eecfdff2e740c3 (diff)
downloadnetpbm-mirror-38243fe783f754d9723f23b797f1b9eda2ba429f.tar.gz
netpbm-mirror-38243fe783f754d9723f23b797f1b9eda2ba429f.tar.xz
netpbm-mirror-38243fe783f754d9723f23b797f1b9eda2ba429f.zip
Add assertion
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4168 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'generator')
-rw-r--r--generator/pbmtext.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/generator/pbmtext.c b/generator/pbmtext.c
index 7ea64857..a4566d12 100644
--- a/generator/pbmtext.c
+++ b/generator/pbmtext.c
@@ -1282,6 +1282,8 @@ computeImageWidth(struct Text          const formattedText,
                   unsigned int *       const colsP,
                   unsigned int *       const maxleftbP) {
 
+    assert (pbm_maxfontwidth() < (INT_MAX - 10) / LINEBUFSIZE);
+
     if (intercharacterSpace < 0 && fontP->maxwidth < -intercharacterSpace)
         pm_error("negative -space value %.2f exceeds font width",
                  intercharacterSpace);