From 37e0207a24837f42db1268e1725174490746045f Mon Sep 17 00:00:00 2001 From: Tapani Pälli Date: Wed, 20 Feb 2013 13:00:08 +0200 Subject: mesa/es: NULL check in EGLImageTargetTexture2DOES MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 (cherry picked from commit 3cdb548bfbc77522ed4e956f7457c8339182ff8c) --- 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 9edd4d84ad..764ccb38b3 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -3182,6 +3182,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); -- cgit v1.2.3