mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-12-11 21:31:30 +00:00
Be more paranoid when dumping qfo type encodings.
This commit is contained in:
parent
f002f3ad7a
commit
d782622e74
1 changed files with 11 additions and 0 deletions
|
@ -432,6 +432,17 @@ qfo_types (qfo_t *qfo)
|
|||
|
||||
for (type_ptr = 4; type_ptr < qfo->spaces[qfo_type_space].data_size;
|
||||
type_ptr += type->size) {
|
||||
if (qfo->spaces[qfo_type_space].data_size - type_ptr < 2) {
|
||||
printf ("%-5x overflow, can't check size. %x\n", type_ptr,
|
||||
qfo->spaces[qfo_type_space].data_size);
|
||||
}
|
||||
if (type_ptr + type->size > qfo->spaces[qfo_type_space].data_size) {
|
||||
printf ("%-5x overflow by %d words. %x\n", type_ptr,
|
||||
(type_ptr + type->size
|
||||
- qfo->spaces[qfo_type_space].data_size),
|
||||
qfo->spaces[qfo_type_space].data_size);
|
||||
continue;
|
||||
}
|
||||
type = &QFO_STRUCT (qfo, qfo_type_space, qfot_type_t, type_ptr);
|
||||
if (type->ty < 0 || type->ty >= NUM_META)
|
||||
meta = "invalid";
|
||||
|
|
Loading…
Reference in a new issue