hw/display: check frame buffer can hold blob
authorAlex Bennée <alex.bennee@linaro.org>
Mon, 11 Nov 2024 23:00:40 +0000 (23:00 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Mon, 18 Nov 2024 15:54:48 +0000 (15:54 +0000)
commitd6902d7022ba1405a991c94a99b37259d0a6d3a7
tree0b9c3f41cd43d69017c63297a6f5f6666d229399
parentc873a6569ff08317578c9810ca049f2c70e3ad99
hw/display: check frame buffer can hold blob

Coverity reports (CID 15647691564770) that we potentially overflow
by doing some 32x32 multiplies for something that ends up in a 64 bit
value. Fix this by first using stride for all lines and casting input
to uint64_t to ensure a 64 bit multiply is used.

Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20241111230040.68470-3-alex.bennee@linaro.org>
hw/display/virtio-gpu.c
include/hw/virtio/virtio-gpu.h