mesa/es: NULL check in EGLImageTargetTexture2DOES
authorTapani Pälli <tapani.palli@intel.com>
Wed, 20 Feb 2013 11:00:08 +0000 (13:00 +0200)
committerChad Versace <chad.versace@linux.intel.com>
Mon, 25 Feb 2013 17:17:31 +0000 (09:17 -0800)
check that pointer passed is valid and return error if not.

Note: This is a candidate for the stable branches.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/main/teximage.c

index f8f517a427bd4af37cb556e57aab799e0703b2bc..f0de0fb4935622d27379cdd08fc1e6bf503ee847 100644 (file)
@@ -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);