From: msweet Date: Mon, 26 Oct 2015 16:24:57 +0000 (+0000) Subject: Return error if we cannot allocate the compression buffer X-Git-Tag: v2.2b1~167 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b9ce33c5b06cd59a100d87bca12d3c776a1c4f3c;p=thirdparty%2Fcups.git Return error if we cannot allocate the compression buffer () git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12932 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-2.1.txt b/CHANGES-2.1.txt index 3ebbc6db15..5ebbee6615 100644 --- a/CHANGES-2.1.txt +++ b/CHANGES-2.1.txt @@ -7,7 +7,8 @@ CHANGES IN CUPS V2.1.1 , , , , , , - , ) + , , + ) - The cupsGetPPD* functions did not work with IPP printers (STR #4725) - Some older HP LaserJet printers need a delayed close when printing using the libusb-based USB backend (STR #4549) diff --git a/filter/raster.c b/filter/raster.c index eff266e9b6..ea4acccbee 100644 --- a/filter/raster.c +++ b/filter/raster.c @@ -1340,7 +1340,15 @@ cups_raster_update(cups_raster_t *r) /* I - Raster stream */ if (r->pixels != NULL) free(r->pixels); - r->pixels = calloc(r->header.cupsBytesPerLine, 1); + if ((r->pixels = calloc(r->header.cupsBytesPerLine, 1)) == NULL) + { + r->pcurrent = NULL; + r->pend = NULL; + r->count = 0; + + return (0); + } + r->pcurrent = r->pixels; r->pend = r->pixels + r->header.cupsBytesPerLine; r->count = 0;