summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/image.c
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-05-13 01:48:04 -0500
committerNicolai Hähnle <nicolai.haehnle@amd.com>2016-06-15 09:27:30 +0200
commit6510e0734563ff8d30e45b8781153367db15cc5b (patch)
treee2fe5349f533a299a641cf5389be2b30712d6ef5 /src/mesa/main/image.c
parenta8a9d1bf41c00123cefb6e757f3509c62e880a15 (diff)
downloadexternal_mesa3d-6510e0734563ff8d30e45b8781153367db15cc5b.zip
external_mesa3d-6510e0734563ff8d30e45b8781153367db15cc5b.tar.gz
external_mesa3d-6510e0734563ff8d30e45b8781153367db15cc5b.tar.bz2
mesa/main: fix integer overflows in _mesa_image_offset
Found using -fsanitize=undefined. Cc: "11.1 11.2 12.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/mesa/main/image.c')
-rw-r--r--src/mesa/main/image.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 4d6ab6f..a039b51 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -151,8 +151,8 @@ _mesa_image_offset( GLuint dimensions,
if (type == GL_BITMAP) {
/* BITMAP data */
- GLint bytes_per_row;
- GLint bytes_per_image;
+ GLintptr bytes_per_row;
+ GLintptr bytes_per_image;
/* components per pixel for color or stencil index: */
const GLint comp_per_pixel = 1;
@@ -170,8 +170,8 @@ _mesa_image_offset( GLuint dimensions,
}
else {
/* Non-BITMAP data */
- GLint bytes_per_pixel, bytes_per_row, remainder, bytes_per_image;
- GLint topOfImage;
+ GLintptr bytes_per_pixel, bytes_per_row, remainder, bytes_per_image;
+ GLintptr topOfImage;
bytes_per_pixel = _mesa_bytes_per_pixel( format, type );