]> granicus.if.org Git - php/commitdiff
Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
authorStanislav Malyshev <stas@php.net>
Sun, 19 Jun 2016 04:57:25 +0000 (21:57 -0700)
committerStanislav Malyshev <stas@php.net>
Sun, 19 Jun 2016 04:57:25 +0000 (21:57 -0700)
ext/gd/libgd/gd_interpolation.c

index 0961c0804801373fe125f0083f88281244036492..4fa23f0a1469a5e8cf2e43d02ec66d4b18521d3e 100644 (file)
@@ -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);