Commits

Anonymous committed 5b7b81f

cacheFetch & gdCacheGet can fails

  • Participants
  • Parent commits bc5cb9d
  • Branches GD-2.0

Comments (0)

Files changed (3)

File src/configure.ac

                  config/gdlib-config
                  test/Makefile
                  tests/Makefile
-                 tests/gdtest/Makefile
                  tests/freetype/Makefile
                  tests/gd/Makefile
                  tests/gd2/Makefile
                  tests/gdimagecopyrotated/Makefile
                  tests/gdimagefill/Makefile
                  tests/gdimagefilledellipse/Makefile
+                 tests/gdimagefilledpolygon/Makefile
                  tests/gdimagefilledrectangle/Makefile
                  tests/gdimagefilltoborder/Makefile
                  tests/gdimageline/Makefile
+                 tests/gdimageopenpolygon/Makefile
+                 tests/gdimagepolygon/Makefile
                  tests/gdimagerectangle/Makefile
                  tests/gdimagesetpixel/Makefile
                  tests/gdimagestringft/Makefile
                  tests/gdimagestringftex/Makefile
                  tests/gdnewfilectx/Makefile
+                 tests/gdtest/Makefile
                  tests/gdtiled/Makefile
                  tests/gif/Makefile
                  tests/jpeg/Makefile

File src/gdcache.c

   key_value_t *map;
 
   map = (key_value_t *) gdMalloc (sizeof (key_value_t));
+  if (!map) {
+	  *error = "gdMalloc failed";
+	  return NULL;
+  }
   map->key = *(int *) key;
   map->value = 3;
 
 
 	      tc_key.bgcolor = *pixel;
 	      tc_elem = (tweencolor_t *) gdCacheGet (tc_cache, &tc_key);
+	      if (!tc_elem) return tc_cache->error;
 	      *pixel = tc_elem->tweencolor;
 	    }
 	}