mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 20:08:06 +02:00
st/mesa: Fix signed integer overflow when using util_throttle_memory_usage
../src/mesa/state_tracker/st_cb_texture.c:1719:57: runtime error: signed integer overflow: 203489280 * 16 cannot be represented in type 'int' Fixes:21ca322e63Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4185> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4185> (cherry picked from commit51b1b102bd)
This commit is contained in:
parent
872de20b21
commit
3cfca286af
2 changed files with 4 additions and 4 deletions
|
|
@ -202,7 +202,7 @@
|
||||||
"description": "st/mesa: Fix signed integer overflow when using util_throttle_memory_usage",
|
"description": "st/mesa: Fix signed integer overflow when using util_throttle_memory_usage",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 1,
|
"nomination_type": 1,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"master_sha": null,
|
"master_sha": null,
|
||||||
"because_sha": "21ca322e637291b89a445159fc45b8dbf638e6c9"
|
"because_sha": "21ca322e637291b89a445159fc45b8dbf638e6c9"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1511,7 +1511,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
|
||||||
}
|
}
|
||||||
|
|
||||||
util_throttle_memory_usage(pipe, &st->throttle,
|
util_throttle_memory_usage(pipe, &st->throttle,
|
||||||
width * height * depth *
|
(uint64_t) width * height * depth *
|
||||||
util_format_get_blocksize(dst->format));
|
util_format_get_blocksize(dst->format));
|
||||||
|
|
||||||
u_box_3d(xoffset, yoffset, zoffset + dstz, width, height, depth, &box);
|
u_box_3d(xoffset, yoffset, zoffset + dstz, width, height, depth, &box);
|
||||||
|
|
@ -1620,7 +1620,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
|
||||||
}
|
}
|
||||||
|
|
||||||
util_throttle_memory_usage(pipe, &st->throttle,
|
util_throttle_memory_usage(pipe, &st->throttle,
|
||||||
width * height * depth *
|
(uint64_t) width * height * depth *
|
||||||
util_format_get_blocksize(src_templ.format));
|
util_format_get_blocksize(src_templ.format));
|
||||||
throttled = true;
|
throttled = true;
|
||||||
|
|
||||||
|
|
@ -1716,7 +1716,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
|
||||||
fallback:
|
fallback:
|
||||||
if (!throttled) {
|
if (!throttled) {
|
||||||
util_throttle_memory_usage(pipe, &st->throttle,
|
util_throttle_memory_usage(pipe, &st->throttle,
|
||||||
width * height * depth *
|
(uint64_t) width * height * depth *
|
||||||
_mesa_get_format_bytes(texImage->TexFormat));
|
_mesa_get_format_bytes(texImage->TexFormat));
|
||||||
}
|
}
|
||||||
_mesa_store_texsubimage(ctx, dims, texImage, xoffset, yoffset, zoffset,
|
_mesa_store_texsubimage(ctx, dims, texImage, xoffset, yoffset, zoffset,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue