st/mesa: disallow the PBO upload fragment shader

It passes image_size to the shader as int32_t.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38587>
This commit is contained in:
Marek Olšák 2025-11-21 20:27:49 -05:00 committed by Marge Bot
parent bd839d4bfc
commit 07d2ab29b6

View file

@ -57,6 +57,10 @@ st_pbo_addresses_setup(struct st_context *st,
{
unsigned skip_pixels;
/* image_size is int32_t */
if ((size_t)addr->pixels_per_row * addr->image_height > INT32_MAX)
return false;
/* Check alignment against texture buffer requirements. */
{
unsigned ofs = (buf_offset * addr->bytes_per_pixel) % st->ctx->Const.TextureBufferOffsetAlignment;