getteximage: fix _mesa_GetTextureSubImage()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 6 Mar 2017 20:33:28 +0000 (21:33 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 6 Mar 2017 20:36:56 +0000 (21:36 +0100)
Oops.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100088
Fixes: 5ae54c0cf7 ("getteximage: avoid to lookup textures with id 0")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/texgetimage.c

index 37fda3dc9c43f70aa5cab3f9ca635a571c435b28..658b0e58e6d7771def3104de452e1493219b36c4 100644 (file)
@@ -1461,7 +1461,7 @@ _mesa_GetTextureSubImage(GLuint texture, GLint level,
    struct gl_texture_object *texObj = NULL;
 
    if (texture > 0)
-      _mesa_lookup_texture(ctx, texture);
+      texObj = _mesa_lookup_texture(ctx, texture);
 
    if (!texObj) {
       _mesa_error(ctx, GL_INVALID_VALUE, "%s(texture)", caller);