mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
mesa: move the format and type check before select_tex_image()
Move the format and type check before select_tex_image, or it will fail to report the mismatch error if the teximage is null. Reported-by: Anuj Phogat <anuj.phogat@gmail.com> Signed-off-by: Jian Zhao <jian.j.zhao@intel.com> Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Signed-off-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
1fdecef886
commit
26195c8417
1 changed files with 6 additions and 6 deletions
|
|
@ -702,12 +702,6 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level,
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
texImage = _mesa_select_tex_image(ctx, texObj, target, level);
|
||||
if (!texImage) {
|
||||
/* out of memory */
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
|
||||
/*GL_INVALID_OPERATION is generated by a format/type
|
||||
* mismatch (see the 1.2 spec page 94, sec 3.6.4.)
|
||||
|
|
@ -716,6 +710,12 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level,
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
texImage = _mesa_select_tex_image(ctx, texObj, target, level);
|
||||
if (!texImage) {
|
||||
/* out of memory */
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
baseFormat = _mesa_get_format_base_format(texImage->TexFormat);
|
||||
|
||||
/* Make sure the requested image format is compatible with the
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue