about summary refs log tree commit diff
path: root/converter/pbm
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-08-09 03:06:48 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-08-09 03:06:48 +0000
commite6e30e94b1da12d0a3247db3b25311bafb8230e6 (patch)
tree546d163508fa3e3b4fa577e85c424357c2027c42 /converter/pbm
parente281482f7522e2ccf8f4fad6f194f7ef7d77ef10 (diff)
downloadnetpbm-mirror-e6e30e94b1da12d0a3247db3b25311bafb8230e6.tar.gz
netpbm-mirror-e6e30e94b1da12d0a3247db3b25311bafb8230e6.tar.xz
netpbm-mirror-e6e30e94b1da12d0a3247db3b25311bafb8230e6.zip
Remove RLE_CHECK_ALLOC and rle_alloc_error from URT library. This fixes a wild pointer dereference as well as cleans up code
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3656 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/pbm')
-rw-r--r--converter/pbm/pbmtolps.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/converter/pbm/pbmtolps.c b/converter/pbm/pbmtolps.c
index 968ec921..d974fcb2 100644
--- a/converter/pbm/pbmtolps.c
+++ b/converter/pbm/pbmtolps.c
@@ -182,8 +182,8 @@ doRaster(FILE *       const ifP,
 
 
 static void
-pbmtolps(FILE * const ifP,
-         FILE * const ofP,
+pbmtolps(FILE *             const ifP,
+         FILE *             const ofP,
          struct CmdlineInfo const cmdline) {
 
     const char * const psName =
@@ -192,13 +192,13 @@ pbmtolps(FILE * const ifP,
     int          rows;
     int          cols;
     int          format;
-    float        scRows;
-    float        scCols;
+    float        scRows, scCols;
+        /* Dimensions of the printed image in points */
 
     pbm_readpbminit(ifP, &cols, &rows, &format);
 
-    scRows = (float) rows / cmdline.dpi * 72.0;
-    scCols = (float) cols / cmdline.dpi * 72.0;
+    scRows = (float) rows / (cmdline.dpi / 72.0);
+    scCols = (float) cols / (cmdline.dpi / 72.0);
 
     if (cmdline.lineWidthSpec)
         validateLineWidth(scCols, scRows, cmdline.lineWidth);