summaryrefslogtreecommitdiff
path: root/ext/gd/gdcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/gdcache.c')
-rw-r--r--ext/gd/gdcache.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/gd/gdcache.c b/ext/gd/gdcache.c
index 2349e38b93..2af6737f74 100644
--- a/ext/gd/gdcache.c
+++ b/ext/gd/gdcache.c
@@ -44,7 +44,7 @@
#else
#include <php_config.h>
#endif
-#if HAVE_LIBFREETYPE && !defined(HAVE_GD_CACHE_CREATE)
+#if HAVE_LIBFREETYPE && !defined(HAVE_GD_BUNDLED)
#include "gdcache.h"
@@ -95,6 +95,11 @@ gdCacheGet( gdCache_head_t *head, void *keydata )
void *userdata;
elem = head->mru;
+ if (elem == NULL) {
+ return NULL;
+
+ }
+
while(elem) {
if ((*(head->gdCacheTest))(elem->userdata, keydata)) {
if (i) { /* if not already most-recently-used */