[Mesa-dev] [PATCH 11/20] mesa/drivers: Add extra null check in blitframebuffer_texture()

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Wed May 14 10:55:57 PDT 2014


If texObj == NULL here it mean there is already GL_INVALID_VALUE
or GL_OUT_OF_MEMORY error set to context.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 src/mesa/drivers/common/meta_blit.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c
index e5a0a9a..c87ebd7 100644
--- a/src/mesa/drivers/common/meta_blit.c
+++ b/src/mesa/drivers/common/meta_blit.c
@@ -425,6 +425,9 @@ blitframebuffer_texture(struct gl_context *ctx,
       srcLevel = 0;
       target = meta_temp_texture->Target;
       texObj = _mesa_lookup_texture(ctx, meta_temp_texture->TexObj);
+      if (texObj == NULL) {
+         return false;
+      }
 
       _mesa_meta_setup_copypix_texture(ctx, meta_temp_texture,
                                        srcX0, srcY0,
-- 
1.8.1.2



More information about the mesa-dev mailing list