Thierry Crozat d3da8a7367 GRAPHICS: Fix undefined behaviour in ManagedSurface blit on opaque target
The color components computation had intermediate results that could overflow
a signed int. So now the computation is done using unsigned int instead, which
prevents the overflow (since the max intermediate value is 255*255*257*257,
which fits in an unsigned int).

Note: I also considered adding an explicit cast to do the uint8 * uint8
operations using uint32, but decided not to as it is not required (there is no
overflow due to integer promotion) and makes the code more difficult to read.
2022-10-31 21:46:22 +00:00
..
2022-10-27 15:56:06 +02:00