]> granicus.if.org Git - php/commitdiff
- ImageCreateFromString(): Fixed segfault that occured if an image was tried to be
authorMathieu Kooiman <mathieu@php.net>
Sat, 4 Nov 2000 20:43:53 +0000 (20:43 +0000)
committerMathieu Kooiman <mathieu@php.net>
Sat, 4 Nov 2000 20:43:53 +0000 (20:43 +0000)
  generate while there was no support for such an image type.

ext/gd/gd.c

index 6db3ce0dc85a318e32953c8812d1015a02ca608d..7f293fcdf7117c71be109db1b2782a59b25fbaa4 100644 (file)
@@ -553,6 +553,7 @@ PHP_FUNCTION (imagecreatefromstring)
                        im = _php_image_create_from_string (data, "JPEG", gdImageCreateFromJpegCtx);
 #else
                        php_error(E_WARNING, "No JPEG support in this PHP build");
+                       RETURN_FALSE;
 #endif
                        break;
 
@@ -561,6 +562,7 @@ PHP_FUNCTION (imagecreatefromstring)
                        im = _php_image_create_from_string (data, "PNG", gdImageCreateFromPngCtx);
 #else
                        php_error(E_WARNING, "No PNG support in this PHP build");
+                       RETURN_FALSE;
 #endif
                        break;
                        
@@ -569,6 +571,7 @@ PHP_FUNCTION (imagecreatefromstring)
                        im = _php_image_create_from_string (data, "GIF", gdImageCreateFromGifCtx);
 #else
                        php_error(E_WARNING, "No GIF support in this PHP build");
+                       RETURN_FALSE;
 #endif
                        break;
 
@@ -577,6 +580,7 @@ PHP_FUNCTION (imagecreatefromstring)
                        im = _php_image_create_from_string (data, "WBMP",gdImageCreateFromWBMPCtx );
 #else
                        php_error(E_WARNING, "No WBMP support in this PHP build");
+                       RETURN_FALSE;
 #endif
                         break;