aboutsummaryrefslogtreecommitdiff
path: root/src/SFileAttributes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/SFileAttributes.cpp')
-rw-r--r--src/SFileAttributes.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/SFileAttributes.cpp b/src/SFileAttributes.cpp
index f947d79..a74b54f 100644
--- a/src/SFileAttributes.cpp
+++ b/src/SFileAttributes.cpp
@@ -328,6 +328,10 @@ int SAttrLoadAttributes(TMPQArchive * ha)
// File table must be initialized
assert(ha->pFileTable != NULL);
+ // Don't load the attributes file from malformer Warcraft III maps
+ if(ha->dwFlags & MPQ_FLAG_MALFORMED)
+ return ERROR_FILE_CORRUPT;
+
// Attempt to open the "(attributes)" file.
// If it's not there, then the archive doesn't support attributes
if(SFileOpenFileEx((HANDLE)ha, ATTRIBUTES_NAME, SFILE_OPEN_ANY_LOCALE, &hFile))