[Mesa-dev] [PATCH] Move the format and type check before select_tex_image, or it will

Brian Paul brian.e.paul at gmail.com
Thu Dec 22 09:45:17 PST 2011


Your subject line / description seems to be truncated.  Can you
describe why the change is being made in more detail? Thanks.

-Brian


On Wed, Dec 21, 2011 at 10:40 PM,  <jian.j.zhao at intel.com> wrote:
> From: Jian Zhao <jian.j.zhao at intel.com>
>
> Reported-by: Anuj Phogat <anuj.phogat at gmail.com>
> Signed-off-by: Jian Zhao <jian.j.zhao at intel.com>
> Reviewed-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
> ---
>  src/mesa/main/texgetimage.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
> index 3f24187..6ead871 100644
> --- a/src/mesa/main/texgetimage.c
> +++ b/src/mesa/main/texgetimage.c
> @@ -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
> --
> 1.7.0.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list