Mesa (master): mesa: add null ptr checks in GetTexParameterI[u]iv() functions

Brian Paul brianp at kemper.freedesktop.org
Thu Aug 4 07:22:48 PDT 2011


Module: Mesa
Branch: master
Commit: 02d81dfcaf073b5f7073d405e931b3d3e9f577ef
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=02d81dfcaf073b5f7073d405e931b3d3e9f577ef

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Aug  4 08:22:31 2011 -0600

mesa: add null ptr checks in GetTexParameterI[u]iv() functions

---

 src/mesa/main/texparam.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 0dec017..97d0359 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -1379,6 +1379,8 @@ _mesa_GetTexParameterIiv(GLenum target, GLenum pname, GLint *params)
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    texObj = get_texobj(ctx, target, GL_TRUE);
+   if (!texObj)
+      return;
    
    switch (pname) {
    case GL_TEXTURE_BORDER_COLOR:
@@ -1399,6 +1401,8 @@ _mesa_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params)
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    texObj = get_texobj(ctx, target, GL_TRUE);
+   if (!texObj)
+      return;
    
    switch (pname) {
    case GL_TEXTURE_BORDER_COLOR:



More information about the mesa-commit mailing list