mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 02:11:19 +00:00
[mdl] Show bytes remaining if not enough for unpack
It turns out Abyss of Pandemonium has a truncated mdl file causing buffer overruns.
This commit is contained in:
parent
a31ff3153c
commit
c26c3b2739
1 changed files with 6 additions and 2 deletions
|
@ -29,7 +29,7 @@ for i in range(m[6]):
|
|||
k[2].append (model[:s])
|
||||
model = model[s:]
|
||||
skins.append (k)
|
||||
pprint (skins)
|
||||
#pprint (skins)
|
||||
|
||||
stverts = []
|
||||
for i in range(m[9]):
|
||||
|
@ -51,7 +51,11 @@ for i in range (m[11]):
|
|||
model = model[4:]
|
||||
if t==0:
|
||||
if m[1] == 6:
|
||||
x = unpack ("3B B 3B B 16s", model[:24])
|
||||
try:
|
||||
x = unpack ("3B B 3B B 16s", model[:24])
|
||||
except:
|
||||
print(len(model))
|
||||
raise
|
||||
f = (t, ((x[:3], x[3]), (x[4:7], x[7]), x[8]), [])
|
||||
model = model[24:]
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue