diff options
author | Tapani Pälli <[email protected]> | 2013-04-18 09:21:27 +0300 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-04-26 06:47:44 -0600 |
commit | 12b0bfa6e92795b4f9c57950ce6c1986618b14b5 (patch) | |
tree | 9d981347a982cc6a298fad4b0ea33d7ff6bca26d /src/mesa | |
parent | c5e8573762e3f72d6fcfe7cc4056803ebea89c7c (diff) |
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 <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/teximage.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 74e985d576c..45a13a73699 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -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; |