From 18f75dadf4f1990dfad413ee9bc61f333c9a1410 Mon Sep 17 00:00:00 2001 From: s1lent Date: Tue, 9 May 2017 21:38:59 +0700 Subject: [PATCH] HLTV: Fix typo. --- rehlds/HLTV/common/DemoFile.cpp | 6 +++--- rehlds/HLTV/common/DemoFile.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rehlds/HLTV/common/DemoFile.cpp b/rehlds/HLTV/common/DemoFile.cpp index faa0e00..e1eea83 100644 --- a/rehlds/HLTV/common/DemoFile.cpp +++ b/rehlds/HLTV/common/DemoFile.cpp @@ -363,10 +363,10 @@ bool DemoFile::LoadDemo(char *demoname) m_FileSystem->Read(&m_EntryNumber, sizeof(int), m_FileHandle); m_CurrentEntry = 0; - if (m_EntryNumber > 0 && m_EntryNumber <= 1024) + if (m_EntryNumber > 0 && m_EntryNumber <= MAX_DEMO_ENTRY) { - m_Entries = (demoentry_t *)Mem_ZeroMalloc(m_EntryNumber * MAX_DEMO_ENTRY); - m_FileSystem->Read(m_Entries, m_EntryNumber * MAX_DEMO_ENTRY, m_FileHandle); + m_Entries = (demoentry_t *)Mem_ZeroMalloc(sizeof(demoentry_t) * m_EntryNumber); + m_FileSystem->Read(m_Entries, sizeof(demoentry_t) * m_EntryNumber, m_FileHandle); m_FileSystem->Seek(m_FileHandle, m_Entries[m_CurrentEntry].nOffset, FILESYSTEM_SEEK_HEAD); } else diff --git a/rehlds/HLTV/common/DemoFile.h b/rehlds/HLTV/common/DemoFile.h index 5f048ff..673f12e 100644 --- a/rehlds/HLTV/common/DemoFile.h +++ b/rehlds/HLTV/common/DemoFile.h @@ -39,7 +39,7 @@ #include "vmodes.h" #include "cdll_int.h" -const int MAX_DEMO_ENTRY = 92; +const int MAX_DEMO_ENTRY = 1024; const int DEMO_PROTOCOL = 5;