Skip to content

Commit 6c3fd1e

Browse files
author
Graylin Kim
committed
Add check for empty files when reading the MPQ header
1 parent bad58f4 commit 6c3fd1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sc2reader/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ def read_header(file):
497497
buffer = ReplayBuffer(file)
498498

499499
#Sanity check that the input is in fact an MPQ file
500-
if buffer.read_hex(4).upper() != "4D50511B":
500+
if buffer.empty or buffer.read_hex(4).upper() != "4D50511B":
501501
print "Header Hex was: %s" % buffer.read_hex(4).upper()
502502
raise ValueError("File '%s' is not an MPQ file" % file.name)
503503

0 commit comments

Comments
 (0)