Mesa (master): st/mesa: don't try to allocate zero-sized renderbuffers

Brian Paul brianp at kemper.freedesktop.org
Tue Nov 29 01:10:51 UTC 2011


Module: Mesa
Branch: master
Commit: 68564726898308c9fd7ac63169bfc2e2012d6fe3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=68564726898308c9fd7ac63169bfc2e2012d6fe3

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Nov 28 18:00:35 2011 -0700

st/mesa: don't try to allocate zero-sized renderbuffers

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43047
and https://bugs.freedesktop.org/show_bug.cgi?id=43048

Note: This is a candidate for the 7.11 branch.

Tested-by: Vinson Lee <vlee at vmware.com>
Signed-off-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/state_tracker/st_cb_fbo.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 1e8ec05..2a60ed4 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -124,6 +124,11 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx,
       pipe_surface_reference( &strb->surface, NULL );
       pipe_resource_reference( &strb->texture, NULL );
 
+      if (width == 0 || height == 0) {
+         /* if size is zero, nothing to allocate */
+         return GL_TRUE;
+      }
+
       /* Setup new texture template.
        */
       memset(&template, 0, sizeof(template));




More information about the mesa-commit mailing list