gallium/util: widen type before multiplication
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 13 Aug 2019 11:02:24 +0000 (13:02 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 15 Aug 2019 18:23:53 +0000 (20:23 +0200)
commit18ab42644b134e3aecd8ea14df3d30eb9b6a80f4
tree66c9ed55482bb1c03021fd8a73168485bbac1bdc
parent0091f62978b26e89e8c0581552b4b91667c658fd
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>
src/gallium/auxiliary/util/u_format.h