Bug 1048 - SIGFPE in cogl_texture_set_region() with nvidia

* clutter/cogl/gl/cogl-texture.c (cogl_texture_set_region):
	* clutter/cogl/gles/cogl-texture.c (cogl_texture_set_region):
	Don't attempt to upload any data if the width or height of the
	subregion is zero. Thanks to Gwenole Beauchesne.
This commit is contained in:
Neil Roberts 2008-09-18 13:16:15 +00:00
parent 3ae77fbfb7
commit 238e9c3a1a
2 changed files with 8 additions and 0 deletions

View File

@ -1552,6 +1552,10 @@ cogl_texture_set_region (CoglHandle handle,
if (format == COGL_PIXEL_FORMAT_ANY)
return FALSE;
/* Shortcut out early if the image is empty */
if (width == 0 || height == 0)
return TRUE;
/* Init source bitmap */
source_bmp.width = width;
source_bmp.height = height;

View File

@ -1558,6 +1558,10 @@ cogl_texture_set_region (CoglHandle handle,
if (format == COGL_PIXEL_FORMAT_ANY)
return FALSE;
/* Shortcut out early if the image is empty */
if (width == 0 || height == 0)
return TRUE;
/* Init source bitmap */
source_bmp.width = width;
source_bmp.height = height;