Commits

Ondřej Surý  committed ad501ab

Enforce 32-bit integer(s) in gdImageAALine

  • Participants
  • Parent commits eca37d6

Comments (0)

Files changed (1)

 static void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col)
 {
 	/* keep them as 32bits */
-	long x, y, inc;
-	long dx, dy,tmp;
-	int w, wid, wstart; 
+	uint32_t x, y;
+	int32_t dx, dy, inc;
+	int tmp, w, wid, wstart; 
 	int thick = im->thick; 
 
 	if (!im->trueColor) {
 			dx = x2 - x1;
 			dy = y2 - y1;
 		}
-		x = x1;
-		y = y1 << 16;
+		x = (uint32_t)x1;
+		y = (uint32_t)y1 << 16;
 		inc = (dy * 65536) / dx;
 		/* TBB: set the last pixel for consistency (<=) */
 		while (x <= x2) {
 			dx = x2 - x1;
 			dy = y2 - y1;
 		}
-		x = x1 << 16;
-		y = y1;
+		x = (uint32_t)x1 << 16;
+		y = (uint32_t)y1;
 		inc = (dx * 65536) / dy;
 		/* TBB: set the last pixel for consistency (<=) */
 		while (y <= y2) {