ddnet/src/game/client/components
bors[bot] 3a28f5fc6e
Merge #4769
4769: Fix integer overflow in CHud when server time exceeds around 248 days r=def- a=Robyt3

Fixes the server timer in the HUD showing 00:00 when the server time exceeds around 248 days.

Tested on "Vanilla Teeworlds Server - CTF":

![303d](https://user-images.githubusercontent.com/23437060/156249076-d3f20853-cd0a-4545-a459-493f123eb5bc.png)

Otherwise connecting to this server causes:

```
/src/game/client/components/hud.cpp:128:17: runtime error: signed integer overflow: 26254443 * 100 cannot be represented in type 'int'
    #0 0x55c8b6722e7d in CHud::RenderGameTimer() /src/game/client/components/hud.cpp:128
    #1 0x55c8b675cdfc in CHud::OnRender() /src/game/client/components/hud.cpp:855
    #2 0x55c8b6babec7 in CGameClient::OnRender() /src/game/client/gameclient.cpp:598
    #3 0x55c8b62b0330 in CClient::Render() /src/engine/client/client.cpp:1179
    #4 0x55c8b6301a62 in CClient::Run() /src/engine/client/client.cpp:3155
    #5 0x55c8b635fc34 in main /src/engine/client/client.cpp:4427
    #6 0x7f581a6150b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
    #7 0x55c8b60f478d in _start (/build-asan/DDNet+0x1bd978d)
```

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [X] Changed no physics that affect existing maps
- [X] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-03-01 22:38:43 +00:00
..
background.cpp Move InitTilemapSkip to CLayers 2022-01-19 22:22:31 +01:00
background.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
binds.cpp CBinds: Remove unused ModifierMatchesKey() 2022-02-07 01:54:12 +03:00
binds.h Binds: Reorder modifiers according to the convention 2022-02-07 01:54:12 +03:00
broadcast.cpp Remove components pointers 2021-07-12 12:14:02 +02:00
broadcast.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
camera.cpp Don't clamp "zoom" command, we already clamp in ChangeZoom 2022-01-26 12:54:19 +01:00
camera.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
chat.cpp Fix Linux build with C++20 2022-02-14 19:19:20 +01:00
chat.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
console.cpp Fix clang-format 2022-02-15 00:32:04 +01:00
console.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
controls.cpp Revert "Add new mouse state" 2021-10-23 13:48:21 +02:00
controls.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
countryflags.cpp Skip the UTF-8 BOM on all read text files 2021-12-17 22:07:01 +01:00
countryflags.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
damageind.cpp Small graphic refactoring 2021-09-14 00:21:17 +02:00
damageind.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
debughud.cpp Add more readability checks 2022-01-22 17:45:25 +01:00
debughud.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
effects.cpp math: Rename frandom() to random_float() to match with random_int() 2021-08-03 14:29:52 +02:00
effects.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
emoticon.cpp Emote -> Emoticon 2022-01-23 19:16:23 +01:00
emoticon.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
flow.cpp Fix all Multiplication type alerts by CodeQL 2020-10-05 19:03:54 +02:00
flow.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
ghost.cpp Allow the ghost to carry any weapon 2022-03-01 22:14:02 +01:00
ghost.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
hud.cpp Fix integer overflow in CHud when server time exceeds around 248 days 2022-03-01 23:22:06 +01:00
hud.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
items.cpp Client: Fix projectiles rendering for demo playback 2022-02-07 02:41:21 +03:00
items.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
killmessages.cpp Reset text color after kill messages are created 2021-10-29 00:11:21 +02:00
killmessages.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
mapimages.cpp invalidate texture when unloading a texture. 2021-09-13 13:23:00 +02:00
mapimages.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
maplayers.cpp Add modernize-use-emplace 2022-02-15 00:15:06 +01:00
maplayers.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
mapsounds.cpp Some char array naming convention 2021-09-13 12:21:56 +02:00
mapsounds.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
menu_background.cpp Add modernize-use-emplace 2022-02-15 00:15:06 +01:00
menu_background.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
menus.cpp Show correct server address when connecting 2022-02-28 19:38:59 +01:00
menus.h client/menus: Fix variable names 2022-02-07 01:50:14 +03:00
menus_browser.cpp Delay double click handling one frame after item activation 2022-02-10 17:40:03 +01:00
menus_demo.cpp Fix listbox item double click behavior 2022-02-20 19:58:24 +01:00
menus_ingame.cpp Delay double click handling one frame after item activation 2022-02-10 17:40:03 +01:00
menus_settings.cpp Fix style 2022-02-20 10:41:06 +01:00
menus_settings_assets.cpp Use ETextAlignment enum for UI 2022-01-21 16:26:19 +01:00
menus_start.cpp Use ETextAlignment enum for UI 2022-01-21 16:26:19 +01:00
motd.cpp More colors from chat in console 2021-03-08 01:20:28 +01:00
motd.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
nameplates.cpp render key presses independent of m_ClNameplates 2022-02-19 13:31:34 +01:00
nameplates.h Show keystrokes in the nametag and new option cl_show_direction_below to show the keypresses below the players 2022-02-11 14:05:37 +01:00
particles.cpp Small graphic refactoring 2021-09-14 00:21:17 +02:00
particles.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
players.cpp Update players.cpp 2022-02-25 06:22:51 -06:00
players.h Show keystrokes in the nametag and new option cl_show_direction_below to show the keypresses below the players 2022-02-11 14:05:37 +01:00
race_demo.cpp Add modernize-deprecated-headers 2022-02-15 00:22:52 +01:00
race_demo.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
scoreboard.cpp Fix string functions not to truncate in the middle of a UTF-8 character 2021-12-20 02:34:02 +01:00
scoreboard.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
skins.cpp CheckImageFormatRGBA --> IsImageFormatRGBA 2022-02-23 00:39:31 +01:00
skins.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
sounds.cpp Enable readability-inconsistent-declaration-parameter-name 2022-01-22 14:12:59 +01:00
sounds.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
spectator.cpp Add modernize-deprecated-headers 2022-02-15 00:22:52 +01:00
spectator.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
statboard.cpp Make use of IO_MAX_PATH_LENGTH 2021-09-13 12:14:50 +02:00
statboard.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
voting.cpp Merge #4623 2022-01-21 21:26:21 +00:00
voting.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00