summaryrefslogtreecommitdiffstats
path: root/Tools/MCADefrag
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Tools/MCADefrag/CMakeLists.txt2
-rw-r--r--Tools/MCADefrag/Globals.h1
-rw-r--r--Tools/MCADefrag/MCADefrag.cpp2
3 files changed, 4 insertions, 1 deletions
diff --git a/Tools/MCADefrag/CMakeLists.txt b/Tools/MCADefrag/CMakeLists.txt
index 82e048671..700310edc 100644
--- a/Tools/MCADefrag/CMakeLists.txt
+++ b/Tools/MCADefrag/CMakeLists.txt
@@ -53,6 +53,7 @@ source_group("Shared" FILES ${SHARED_SRC} ${SHARED_HDR})
set(SHARED_OSS_SRC
../../src/OSSupport/CriticalSection.cpp
+ ../../src/OSSupport/Event.cpp
../../src/OSSupport/File.cpp
../../src/OSSupport/IsThread.cpp
../../src/OSSupport/StackTrace.cpp
@@ -60,6 +61,7 @@ set(SHARED_OSS_SRC
set(SHARED_OSS_HDR
../../src/OSSupport/CriticalSection.h
+ ../../src/OSSupport/Event.h
../../src/OSSupport/File.h
../../src/OSSupport/IsThread.h
../../src/OSSupport/StackTrace.h
diff --git a/Tools/MCADefrag/Globals.h b/Tools/MCADefrag/Globals.h
index 288069599..f13a06566 100644
--- a/Tools/MCADefrag/Globals.h
+++ b/Tools/MCADefrag/Globals.h
@@ -201,6 +201,7 @@ typedef unsigned char Byte;
// Common headers (without macros):
#include "StringUtils.h"
#include "OSSupport/CriticalSection.h"
+#include "OSSupport/Event.h"
#include "OSSupport/IsThread.h"
#include "OSSupport/File.h"
diff --git a/Tools/MCADefrag/MCADefrag.cpp b/Tools/MCADefrag/MCADefrag.cpp
index d5d233fd2..0d38a87f1 100644
--- a/Tools/MCADefrag/MCADefrag.cpp
+++ b/Tools/MCADefrag/MCADefrag.cpp
@@ -269,7 +269,7 @@ bool cMCADefrag::cThread::ReadChunk(cFile & a_File, const Byte * a_LocationRaw)
return false;
}
m_CompressedChunkDataSize = (Buf[0] << 24) | (Buf[1] << 16) | (Buf[2] << 8) | Buf[3];
- if (m_CompressedChunkDataSize > SizeInSectors)
+ if ((m_CompressedChunkDataSize > SizeInSectors) || (m_CompressedChunkDataSize < 0))
{
LOGWARNING("Invalid chunk data - SizeInSectors (%d) smaller that RealSize (%d)", SizeInSectors, m_CompressedChunkDataSize);
return false;