mesa: add KHR_no_error support for glDepthRangeIndexed()
[mesa.git] / src / mesa / main / texgetimage.c
index d5cb1636605b54b4cbc919a8ef29a03f7e45f38f..715bc249be12182954d90ba108bdc42493844d3c 100644 (file)
@@ -1465,6 +1465,12 @@ _mesa_GetTextureSubImage(GLuint texture, GLint level,
       return;
    }
 
+   if (!legal_getteximage_target(ctx, texObj->Target, true)) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "%s(buffer/multisample texture)", caller);
+      return;
+   }
+
    if (getteximage_error_check(ctx, texObj, texObj->Target, level,
                                xoffset, yoffset, zoffset, width, height, depth,
                                format, type, bufSize, pixels, caller)) {
@@ -1767,7 +1773,7 @@ _mesa_GetCompressedTextureSubImage(GLuint texture, GLint level,
 {
    GET_CURRENT_CONTEXT(ctx);
    static const char *caller = "glGetCompressedTextureImage";
-   struct gl_texture_object *texObj;
+   struct gl_texture_object *texObj = NULL;
 
    texObj = _mesa_lookup_texture_err(ctx, texture, caller);
    if (!texObj) {