summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2020-03-19 13:53:45 +0100
committerThomas Deutschmann <whissi@gentoo.org>2020-08-13 11:28:25 +0200
commitdc2ba49207af71193f1390d84bba4e15aeea0ce0 (patch)
tree79c2a51cb5fa2b87800b1113e0015a7108cd2eb3 /devices/gdevimgn.c
parentImport Ghostscript 9.50 (diff)
downloadghostscript-gpl-patches-dc2ba49207af71193f1390d84bba4e15aeea0ce0.tar.gz
ghostscript-gpl-patches-dc2ba49207af71193f1390d84bba4e15aeea0ce0.tar.bz2
ghostscript-gpl-patches-dc2ba49207af71193f1390d84bba4e15aeea0ce0.zip
Import Ghostscript 9.52ghostscript-9.52
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'devices/gdevimgn.c')
-rw-r--r--devices/gdevimgn.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/devices/gdevimgn.c b/devices/gdevimgn.c
index 7340c8d4..7c707bda 100644
--- a/devices/gdevimgn.c
+++ b/devices/gdevimgn.c
@@ -379,6 +379,7 @@ imagen_print_page(gx_device_printer *pdev, gp_file *prn_stream)
/* page totals */
int totalBlankSwatches;
int totalGreySwatches;
+ int code = 0;
/* ----------------------------------------- */
/* Start of routine */
@@ -406,8 +407,8 @@ imagen_print_page(gx_device_printer *pdev, gp_file *prn_stream)
swatchMap = (byte *)gs_malloc(pdev->memory, BIGSIZE,swatchCount / BIGSIZE + 1,
"imagen_print_page(swatchMap)" );
- if ( in == 0 || out == 0 )
- return -1;
+ if ( in == 0 || out == 0 || swatchMap == 0)
+ goto xit;
/* Initialize the page */
iWrite(prn_stream,iPAGE);
@@ -450,7 +451,9 @@ imagen_print_page(gx_device_printer *pdev, gp_file *prn_stream)
} /* for temp */
/* get one line */
- gdev_prn_copy_scan_lines(pdev, lnum + swatchLine, in, line_size);
+ code = gdev_prn_copy_scan_lines(pdev, lnum + swatchLine, in, line_size);
+ if (code < 0)
+ goto xit;
DebugMsg(5,"Got scan line %d ", lnum + swatchLine);
DebugMsg(5,"line %d \n", swatchLine);
@@ -553,6 +556,7 @@ imagen_print_page(gx_device_printer *pdev, gp_file *prn_stream)
gp_fflush(prn_stream);
+xit:
gs_free(pdev->memory, (char *)out, TotalBytesPerSw, swatchCount+1, "imagen_print_page(out)");
gs_free(pdev->memory, (char *)swatchMap, BIGSIZE, swatchCount / BIGSIZE + 1,
"imagen_print_page(swatchMap)" );
@@ -564,6 +568,6 @@ imagen_print_page(gx_device_printer *pdev, gp_file *prn_stream)
DebugMsg(1,"%s\n","End of imagen_print_page");
/* ----------------------------------------- */
- return 0;
+ return code;
} /* imagen_print_page */