Anonymous avatar Anonymous committed 5b7b81f

cacheFetch & gdCacheGet can fails

Comments (0)

Files changed (3)

                  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
   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;
 	    }
 	}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.