mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 22:30:12 +01:00
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:
parent
bd839d4bfc
commit
07d2ab29b6
1 changed files with 4 additions and 0 deletions
|
|
@ -57,6 +57,10 @@ st_pbo_addresses_setup(struct st_context *st,
|
||||||
{
|
{
|
||||||
unsigned skip_pixels;
|
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. */
|
/* Check alignment against texture buffer requirements. */
|
||||||
{
|
{
|
||||||
unsigned ofs = (buf_offset * addr->bytes_per_pixel) % st->ctx->Const.TextureBufferOffsetAlignment;
|
unsigned ofs = (buf_offset * addr->bytes_per_pixel) % st->ctx->Const.TextureBufferOffsetAlignment;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue