Anonymous avatar Anonymous committed 1fd2ca4

- sync to 2.0.29

Comments (0)

Files changed (2)

         gdImageAlphaBlending(im, TRUE);
 
 	gdImageFilledRectangle (im, 30, 30, 70, 70, green);
-	gdImageStringFT (im, NULL, black, "times", 18, 0, 50, 50, "Hello");
+	gdImageStringFT (im, NULL, black, "Times", 18, 0, 50, 50, "Hello");
 
 	gdImageSaveAlpha (im, TRUE);
 
   if ((wbmp = (Wbmp *) gdMalloc (sizeof (Wbmp))) == NULL)
     return (NULL);
 
+  if (overflow2(sizeof (int), width)) {
+    gdFree(wbmp);
+    return NULL;
+  }
+  if (overflow2(sizeof (int) * width, height)) {
+    gdFree(wbmp);
+    return NULL;
+  }
   if ((wbmp->bitmap =
        (int *) gdMalloc (sizeof (int) * width * height)) == NULL)
     {
   printf ("W: %d, H: %d\n", wbmp->width, wbmp->height);
 #endif
 
+  if (overflow2(sizeof (int), wbmp->width) ||
+    overflow2(sizeof (int) * wbmp->width, wbmp->height))
+    {
+      gdFree(wbmp);
+      return (-1);
+    }
   if ((wbmp->bitmap =
        (int *) gdMalloc (sizeof (int) * wbmp->width * wbmp->height)) == NULL)
     {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.