AAS_LoadAASLump will return 0/NULL in an error case. However it will also return the input buffer pointer if length is 0, and the input buffer pointer may be 0/NULL in the case where AAS_LoadAASLump is meant to allocate memory. This means that it can return 0/NULL in a perfectly legal case where the lump length is 0. Since AAS_LoadAASFile inteprets this as a fatal error, that's bad. I'm not sure how to best disambiguate this, but a low-touch fix is for the caller of AAS_LoadAASLump to be OK with a returned NULL pointer if the lump length is 0. Also: added a missing break statement to avoid a spurious "don't know what to do" message when using the aasinfo switch. |
||
|---|---|---|
| .. | ||
| mbspc | ||
| quake2 | ||
| quake3 | ||