mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 17:10:11 +01:00
gallium/util: widen type before multiplication
This method returns size_t, but the multiplication multiplies two integers, leading to overflow rather than type widening. Noticed by compiling with MSVC, which emits a warning. Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
0091f62978
commit
18ab42644b
1 changed files with 1 additions and 1 deletions
|
|
@ -870,7 +870,7 @@ static inline size_t
|
|||
util_format_get_stride(enum pipe_format format,
|
||||
unsigned width)
|
||||
{
|
||||
return util_format_get_nblocksx(format, width) * util_format_get_blocksize(format);
|
||||
return (size_t)util_format_get_nblocksx(format, width) * util_format_get_blocksize(format);
|
||||
}
|
||||
|
||||
static inline size_t
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue