Blame SOURCES/autotrace-0.31.1-CVE-2022-32323.patch

63f21f
--- autotrace-0.31.1.old/input-bmp.c	2022-09-05 14:41:15.694254375 +0530
63f21f
+++ autotrace-0.31.1/input-bmp.c	2022-09-08 17:11:28.131973020 +0530
63f21f
@@ -88,7 +88,7 @@
63f21f
 		  at_address msg_data)
63f21f
 {
63f21f
   FILE *fd;
63f21f
-  unsigned char buffer[64];
63f21f
+  unsigned char buffer[128];
63f21f
   int ColormapSize, rowbytes, Maps, Grey;
63f21f
   unsigned char ColorMap[256][3];
63f21f
   at_bitmap_type image = at_bitmap_init(0, 0, 0, 1);
63f21f
@@ -345,6 +345,10 @@
63f21f
                *(temp++)= buffer[xpos * 4 + 1];
63f21f
                *(temp++)= buffer[xpos * 4];
63f21f
             }
63f21f
+
63f21f
+          if (ypos == 0)
63f21f
+	    break;
63f21f
+
63f21f
           --ypos; /* next line */
63f21f
         }
63f21f
     }
63f21f
@@ -361,6 +365,10 @@
63f21f
                *(temp++)= buffer[xpos * 3 + 1];
63f21f
                *(temp++)= buffer[xpos * 3];
63f21f
             }
63f21f
+            
63f21f
+          if (ypos == 0)
63f21f
+	    break;
63f21f
+
63f21f
           --ypos; /* next line */
63f21f
         }
63f21f
 	}
63f21f
@@ -378,6 +386,10 @@
63f21f
                *(temp++)= (unsigned char)(((rgb >> 5)  & 0x1f) * 8);
63f21f
                *(temp++)= (unsigned char)(((rgb)       & 0x1f) * 8);
63f21f
             }
63f21f
+
63f21f
+          if (ypos == 0)
63f21f
+	    break;
63f21f
+
63f21f
           --ypos; /* next line */
63f21f
         }
63f21f
     }