Commits

Pierre Joye  committed 3c5c639 Merge

Merged in suetanvil/gd-libgd/suetanvil (pull request #12)

Fixed memory overrun bug in gdImageScaleTwoPass

  • Participants
  • Parent commits de7acbf, 4f65a3e

Comments (0)

Files changed (1)

File src/gd_interpolation.c

 		double dTotalWeight = 0.0;
 		int iSrc;
 
-		res->ContribRow[u].Left = iLeft;
-		res->ContribRow[u].Right = iRight;
-
 		/* Cut edge points to fit in filter window in case of spill-off */
 		if (iRight - iLeft + 1 > windows_size)  {
 			if (iLeft < ((int)src_size - 1 / 2))  {
 			}
 		}
 
+		res->ContribRow[u].Left = iLeft;
+		res->ContribRow[u].Right = iRight;
+
 		for (iSrc = iLeft; iSrc <= iRight; iSrc++) {
 			dTotalWeight += (res->ContribRow[u].Weights[iSrc-iLeft] =  scale_f_d * (*pFilter)(scale_f_d * (dCenter - (double)iSrc)));
 		}