mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
st/mesa: avoid integer overflows with buffers >= 512MB
This fixes failures with the newly-submitted max-size texture buffer piglit test for GPUs exposing >= 128M max texels. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
This commit is contained in:
parent
1aff899a87
commit
eb081681df
1 changed files with 2 additions and 2 deletions
|
|
@ -274,8 +274,8 @@ st_create_texture_sampler_view_from_stobj(struct pipe_context *pipe,
|
|||
return NULL;
|
||||
size = MIN2(stObj->pt->width0 - base, (unsigned)stObj->base.BufferSize);
|
||||
|
||||
f = ((base * 8) / desc->block.bits) * desc->block.width;
|
||||
n = ((size * 8) / desc->block.bits) * desc->block.width;
|
||||
f = (base / (desc->block.bits / 8)) * desc->block.width;
|
||||
n = (size / (desc->block.bits / 8)) * desc->block.width;
|
||||
if (!n)
|
||||
return NULL;
|
||||
templ.u.buf.first_element = f;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue