File cups-filters-1.25.0-CVE-2025-64524.patch of Package cups-filters.41636

--- filter/rastertopclx.c.orig	2019-06-06 15:17:11.000000000 +0200
+++ filter/rastertopclx.c	2025-11-14 11:02:50.269394094 +0100
@@ -818,10 +818,10 @@ StartPage(ppd_file_t         *ppd,	/* I
   }
 
   if (header->cupsCompression)
-    CompBuffer = malloc(DotBufferSize * 4);
+    CompBuffer = calloc(DotBufferSize * 4, sizeof(unsigned char));
 
   if (header->cupsCompression >= 3)
-    SeedBuffer = malloc(DotBufferSize);
+    SeedBuffer = calloc(DotBufferSize, sizeof(unsigned char));
 
   SeedInvalid = 1;
 
@@ -1152,6 +1152,9 @@ CompressData(unsigned char *line,	/* I -
               seed ++;
               count ++;
             }
+            // Bail out if we don't have count to compress
+            if (count == 0)
+              break;
 	  }
 
          /*
@@ -1244,6 +1247,9 @@ CompressData(unsigned char *line,	/* I -
             }
 
             count = line_ptr - start;
+            // Bail out if we don't have count to compress
+            if (count == 0)
+              break;
 
 #if 0
             fprintf(stderr, "DEBUG: offset=%d, count=%d, comp_ptr=%p(%d of %d)...\n",
@@ -1415,6 +1421,9 @@ CompressData(unsigned char *line,	/* I -
             }
 
             count = (line_ptr - start) / 3;
+            // Bail out if we don't have count to compress
+            if (count == 0)
+              break;
 
            /*
             * Place mode 10 compression data in the buffer; each sequence
openSUSE Build Service is sponsored by