summaryrefslogtreecommitdiff
path: root/src/SFilePatchArchives.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/SFilePatchArchives.cpp')
-rw-r--r--src/SFilePatchArchives.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/SFilePatchArchives.cpp b/src/SFilePatchArchives.cpp
index d01aaf2..840f86c 100644
--- a/src/SFilePatchArchives.cpp
+++ b/src/SFilePatchArchives.cpp
@@ -671,7 +671,7 @@ int Patch_InitPatcher(TMPQPatcher * pPatcher, TMPQFile * hf)
DWORD cbMaxFileData = 0;
// Overflow check
- if((sizeof(MPQ_PATCH_HEADER) + cbMaxFileData) < cbMaxFileData)
+ if((cbMaxFileData + (DWORD)sizeof(MPQ_PATCH_HEADER)) < cbMaxFileData)
return ERROR_NOT_ENOUGH_MEMORY;
if(hf->hfPatch == NULL)
return ERROR_INVALID_PARAMETER;