autotrace/autotrace-0.31.1-CVE-2022-3...

45 lines
1.1 KiB
Diff

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