Skip to content

Instantly share code, notes, and snippets.

/72407.diff Secret

Created June 19, 2016 04:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9d931510dad3f5678a964d84d7d085a3 to your computer and use it in GitHub Desktop.
Save anonymous/9d931510dad3f5678a964d84d7d085a3 to your computer and use it in GitHub Desktop.
Patch for 72407
commit b9ec171e7d25879d97473ca50197c4207420c276
Author: Stanislav Malyshev <stas@php.net>
Date: Sat Jun 18 21:57:25 2016 -0700
Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c
index 0961c08..4fa23f0 100644
--- a/ext/gd/libgd/gd_interpolation.c
+++ b/ext/gd/libgd/gd_interpolation.c
@@ -1049,6 +1049,9 @@ static inline void _gdScaleVert (const gdImagePtr pSrc, const unsigned int src_w
}
contrib = _gdContributionsCalc(dst_height, src_height, (double)(dst_height) / (double)(src_height), pSrc->interpolation);
+ if (contrib == NULL) {
+ return;
+ }
/* scale each column */
for (u = 0; u < dst_width - 1; u++) {
_gdScaleCol(pSrc, src_width, pDst, dst_width, dst_height, u, contrib);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment