diff options
Diffstat (limited to 'apps/plugins/sdl/progs/quake/common.c')
| -rw-r--r-- | apps/plugins/sdl/progs/quake/common.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/plugins/sdl/progs/quake/common.c b/apps/plugins/sdl/progs/quake/common.c index 5191af8..cc50311 100644 --- a/apps/plugins/sdl/progs/quake/common.c +++ b/apps/plugins/sdl/progs/quake/common.c @@ -1621,6 +1621,9 @@ byte *COM_LoadFile (char *path, int usehunk) if (h == -1) return NULL; + if(len < 1) + rb->splashf(HZ, "suspicious length %d", len); + check_ptr = &h; //printf("handle %d", h); @@ -1642,9 +1645,15 @@ byte *COM_LoadFile (char *path, int usehunk) else if (usehunk == 4) { if (len+1 > loadsize) + { + LOGF("LoadFile: allocating hunk b/c stackbuf too small (filelen=%d)\n", len); buf = Hunk_TempAlloc (len+1); + } else + { + LOGF("filelen=%d, using stack buf\n", len); buf = loadbuf; + } } else Sys_Error ("COM_LoadFile: bad usehunk"); |