zink: avoid overflow when calculating size
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 25 Aug 2021 19:44:46 +0000 (21:44 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 27 Aug 2021 18:32:03 +0000 (18:32 +0000)
commite3239dff05cef15190dfe34337693b58aa14fb99
tree039119df6f85100288097d55ef9ab421adfd0dba
parentc96afa9fc8d4c1e8ed9fe0c44b0f14a817924b8f
zink: avoid overflow when calculating size

If we multiply before we (implicitly) cast the result to the target
type, we needlessly risk overflowing the result.

CID: 14907901475922

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12559>
src/gallium/drivers/zink/zink_resource.c