summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMichael Sweet <michael.r.sweet@gmail.com>2017-01-17 11:59:38 -0500
committerMichael Sweet <michael.r.sweet@gmail.com>2017-01-17 11:59:38 -0500
commit316c332fa0d8f3671574756d54b50d3d07805207 (patch)
tree2b229ce21e5ef13ce260dbb843efd123da8d6483 /filter
parented6f435e1cbffd23012ee53fbfddca5de1f4ea88 (diff)
downloadcups-316c332fa0d8f3671574756d54b50d3d07805207.tar.gz
Fix rastertopwg line offset bug (Issue #4942)
Diffstat (limited to 'filter')
-rw-r--r--filter/rastertopwg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/filter/rastertopwg.c b/filter/rastertopwg.c
index 5026f5654..5413df04c 100644
--- a/filter/rastertopwg.c
+++ b/filter/rastertopwg.c
@@ -1,7 +1,7 @@
/*
* CUPS raster to PWG raster format filter for CUPS.
*
- * Copyright 2011, 2014-2016 Apple Inc.
+ * Copyright 2011, 2014-2017 Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright law.
@@ -435,6 +435,9 @@ main(int argc, /* I - Number of command-line args */
if (linesize < inheader.cupsBytesPerLine)
linesize = inheader.cupsBytesPerLine;
+ if ((lineoffset + inheader.cupsBytesPerLine) > linesize)
+ lineoffset = linesize - inheader.cupsBytesPerLine;
+
line = malloc(linesize);
memset(line, white, linesize);