From 810bad9fd8cf344f7d73b82f042910a4c443b0f7 Mon Sep 17 00:00:00 2001 From: erorcun Date: Fri, 29 Jan 2021 01:44:33 +0300 Subject: Fix some UBs --- src/audio/MusicManager.cpp | 5 ++++- src/audio/MusicManager.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/audio') diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp index acfe09c3..374de081 100644 --- a/src/audio/MusicManager.cpp +++ b/src/audio/MusicManager.cpp @@ -1223,8 +1223,11 @@ cMusicManager::DisplayRadioStationName() gNumRetunePresses++; } else +#ifdef FIX_BUGS + track = m_nFrontendTrack == NO_TRACK ? POLICE_RADIO : m_nFrontendTrack; +#else track = m_nFrontendTrack; - +#endif wchar* string = nil; switch (track) { diff --git a/src/audio/MusicManager.h b/src/audio/MusicManager.h index f103e84e..5691b7b8 100644 --- a/src/audio/MusicManager.h +++ b/src/audio/MusicManager.h @@ -29,7 +29,7 @@ public: uint32 m_nResetTime; bool m_bRadioSetByScript; uint8 m_nRadioStation; - uint32 m_nRadioPosition; + int32 m_nRadioPosition; uint32 m_nRadioInCar; uint32 m_nFrontendTrack; uint32 m_nPlayingTrack; -- cgit v1.2.3