mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-19 02:38:32 +00:00

In DW2, some large TINSEL_EVENT values are read, and they're bigger than the last TINSEL_EVENT value, but we cast them to `enum TINSEL_EVENT` values in tinlib.cpp, which is apparently "unspecified behavior up to C++17 and undefined behavior starting from C++17". tinlib.cpp:1925:39: runtime error: load of value 9041, which is not a valid value for type 'Tinsel::TINSEL_EVENT' tinlib.cpp:1935:31: runtime error: load of value 77, which is not a valid value for type 'Tinsel::TINSEL_EVENT' Found with UBSan but the really clear help comes from PVS-Studio documentation.