[Mesa-dev] [PATCH 2/2] mesa/es: NULL check in EGLImageTargetTexture2DOES

Tapani Pälli tapani.palli at intel.com
Wed Feb 20 03:00:08 PST 2013


check that pointer passed is valid and return error if not.

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 src/mesa/main/teximage.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index f8f517a..f0de0fb 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -3187,6 +3187,12 @@ _mesa_EGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image)
       return;
    }
 
+   if (!image) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+		  "glEGLImageTargetTexture2D(image=%p)", image);
+      return;
+   }
+
    if (ctx->NewState & _NEW_PIXEL)
       _mesa_update_state(ctx);
 
-- 
1.8.1.2



More information about the mesa-dev mailing list