]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Return error if we cannot allocate the compression buffer
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 26 Oct 2015 16:24:57 +0000 (16:24 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 26 Oct 2015 16:24:57 +0000 (16:24 +0000)
(<rdar://problem/23134228>)

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12932 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-2.1.txt
filter/raster.c

index 3ebbc6db1587cdd9a471968c6a99adcf385746c9..5ebbee6615d07eeca8ebea6016ae8532a126908b 100644 (file)
@@ -7,7 +7,8 @@ CHANGES IN CUPS V2.1.1
          <rdar://problem/23132108>, <rdar://problem/23132353>,
          <rdar://problem/23132803>, <rdar://problem/23133230>,
          <rdar://problem/23133393>, <rdar://problem/23133466>,
-         <rdar://problem/23133833>, <rdar://problem/23133998>)
+         <rdar://problem/23133833>, <rdar://problem/23133998>,
+         <rdar://problem/23134228>)
        - 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)
index eff266e9b6faa199aae24a424774edf5b094ceb4..ea4acccbee63bb13a0356c2a34328e0c850da295 100644 (file)
@@ -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;