From 3cdb548bfbc77522ed4e956f7457c8339182ff8c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tapani=20P=C3=A4lli?= Date: Wed, 20 Feb 2013 13:00:08 +0200 Subject: [PATCH] mesa/es: NULL check in EGLImageTargetTexture2DOES MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ian Romanick Reviewed-by: Chad Versace --- 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 f8f517a427b..f0de0fb4935 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); -- 2.30.2