mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 11:20:20 +01:00
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>
This commit is contained in:
parent
a8a9d1bf41
commit
6510e07345
1 changed files with 4 additions and 4 deletions
|
|
@ -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 );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue