summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2018-01-24 20:33:26 +0100
committeroy <Tom_Adams@web.de>2018-01-24 20:45:52 +0100
commit73216445c3446e76854a9409f175b34f37761108 (patch)
tree28f6cde7ad3259392480862194266af88b5c9744
parent24957d70866c9d2d2b7d7c79ad85d4612e1dfb3a (diff)
added "Limit m_NumTimelineMarkers" by def-. (#1507)
-rw-r--r--src/engine/shared/demo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/engine/shared/demo.cpp b/src/engine/shared/demo.cpp
index 49b509fa6..0187f963d 100644
--- a/src/engine/shared/demo.cpp
+++ b/src/engine/shared/demo.cpp
@@ -680,8 +680,8 @@ int CDemoPlayer::Load(class IStorage *pStorage, class IConsole *pConsole, const
// get timeline markers
int Num = ((m_Info.m_TimelineMarkers.m_aNumTimelineMarkers[0]<<24)&0xFF000000) | ((m_Info.m_TimelineMarkers.m_aNumTimelineMarkers[1]<<16)&0xFF0000) |
((m_Info.m_TimelineMarkers.m_aNumTimelineMarkers[2]<<8)&0xFF00) | (m_Info.m_TimelineMarkers.m_aNumTimelineMarkers[3]&0xFF);
- m_Info.m_Info.m_NumTimelineMarkers = Num;
- for(int i = 0; i < Num && i < MAX_TIMELINE_MARKERS; i++)
+ m_Info.m_Info.m_NumTimelineMarkers = min(Num, int(MAX_TIMELINE_MARKERS));
+ for(int i = 0; i < m_Info.m_Info.m_NumTimelineMarkers; i++)
{
char *pTimelineMarker = m_Info.m_TimelineMarkers.m_aTimelineMarkers[i];
m_Info.m_Info.m_aTimelineMarkers[i] = ((pTimelineMarker[0]<<24)&0xFF000000) | ((pTimelineMarker[1]<<16)&0xFF0000) |