[Scummvm-git-logs] scummvm-tools master -> 13915a8c1d06be5239834a6fb08d7195d74ee363

aquadran noreply at scummvm.org
Thu Oct 16 16:12:05 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-tools' repo located at https://api.github.com/repos/scummvm/scummvm-tools .

Summary:
13915a8c1d WINTERMUTE: Gracefully handle end of file


Commit: 13915a8c1d06be5239834a6fb08d7195d74ee363
    https://github.com/scummvm/scummvm-tools/commit/13915a8c1d06be5239834a6fb08d7195d74ee363
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2025-10-16T18:12:00+02:00

Commit Message:
WINTERMUTE: Gracefully handle end of file

Changed paths:
    engines/wintermute/dcp_extractor.py


diff --git a/engines/wintermute/dcp_extractor.py b/engines/wintermute/dcp_extractor.py
index 53505ee2..d7d3bbfa 100755
--- a/engines/wintermute/dcp_extractor.py
+++ b/engines/wintermute/dcp_extractor.py
@@ -36,7 +36,8 @@ def read_struct(f, fmt, constructor):
 def read_str(f):
     sz = f.read(1)
     if len(sz) != 1:
-        raise Exception("File too small")
+        print("End of file!")
+        return ""
     sz, = struct.unpack('<B', sz)
     s = f.read(sz)
     if len(s) != sz:
@@ -69,6 +70,8 @@ def read_headers(f, abs_offset = 0):
 
         for i in range(dirent.num_entries):
             fname = read_str(f)
+            if (fname == ""):
+                break
             fname = bytes(b ^ 0x44 for b in fname)
             fname = fname.rstrip(b'\x00')
 




More information about the Scummvm-git-logs mailing list