mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 08:40:11 +01:00
mesa: fix type comparison errors in sub-texture error checking code
patch fixes a crash that happens if glTexSubImage2D is called with a negative xoffset. NOTE: This is a candidate for stable branches. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
c5e8573762
commit
12b0bfa6e9
1 changed files with 5 additions and 5 deletions
|
|
@ -1536,13 +1536,13 @@ error_check_subtexture_dimensions(struct gl_context *ctx,
|
|||
}
|
||||
|
||||
/* check xoffset and width */
|
||||
if (xoffset < -destImage->Border) {
|
||||
if (xoffset < - (GLint) destImage->Border) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "%s%dD(xoffset)",
|
||||
function, dims);
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
if (xoffset + subWidth > destImage->Width) {
|
||||
if (xoffset + subWidth > (GLint) destImage->Width) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "%s%dD(xoffset+width)",
|
||||
function, dims);
|
||||
return GL_TRUE;
|
||||
|
|
@ -1556,7 +1556,7 @@ error_check_subtexture_dimensions(struct gl_context *ctx,
|
|||
function, dims);
|
||||
return GL_TRUE;
|
||||
}
|
||||
if (yoffset + subHeight > destImage->Height) {
|
||||
if (yoffset + subHeight > (GLint) destImage->Height) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "%s%dD(yoffset+height)",
|
||||
function, dims);
|
||||
return GL_TRUE;
|
||||
|
|
@ -1595,13 +1595,13 @@ error_check_subtexture_dimensions(struct gl_context *ctx,
|
|||
}
|
||||
|
||||
/* size must be multiple of bw by bh or equal to whole texture size */
|
||||
if ((subWidth % bw != 0) && subWidth != destImage->Width) {
|
||||
if ((subWidth % bw != 0) && subWidth != (GLint) destImage->Width) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"%s%dD(width = %d)", function, dims, subWidth);
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
if ((subHeight % bh != 0) && subHeight != destImage->Height) {
|
||||
if ((subHeight % bh != 0) && subHeight != (GLint) destImage->Height) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"%s%dD(height = %d)", function, dims, subHeight);
|
||||
return GL_TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue