From: Brian Paul Date: Tue, 16 Sep 2008 17:59:24 +0000 (-0600) Subject: gallium: fix glTexImage(width=height=depth=0) case X-Git-Tag: 062012170305~17580^2~390^2~319 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37607aeaf8b0fd35213635ba1c3743b6e059d48f;p=profile%2Fivi%2Fmesa.git gallium: fix glTexImage(width=height=depth=0) case Free old teximage/level data, then stop. --- diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index a3e8fc9..2ba3766 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -455,6 +455,11 @@ st_TexImage(GLcontext * ctx, _mesa_align_free(texImage->Data); } + if (width == 0 || height == 0 || depth == 0) { + /* stop after freeing old image */ + return; + } + /* If this is the only mipmap level in the texture, could call * bmBufferData with NULL data to free the old block and avoid * waiting on any outstanding fences.