summaryrefslogtreecommitdiff
path: root/ext/gd/libgd/gd_interpolation.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/libgd/gd_interpolation.c')
-rw-r--r--ext/gd/libgd/gd_interpolation.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c
index c88dc7251e..d805ec93e6 100644
--- a/ext/gd/libgd/gd_interpolation.c
+++ b/ext/gd/libgd/gd_interpolation.c
@@ -2166,6 +2166,10 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const
gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor)
{
const int angle_rounded = (int)floor(angle * 100);
+
+ if (bgcolor < 0) {
+ return NULL;
+ }
/* no interpolation needed here */
switch (angle_rounded) {