mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
wad pics don't have extensions (plugs a buffer underflow hole)
This commit is contained in:
parent
7e657c49f1
commit
ba3601685c
1 changed files with 5 additions and 6 deletions
|
@ -44,6 +44,7 @@ static __attribute__ ((unused)) const char rcsid[] =
|
|||
#include "QF/console.h"
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/draw.h"
|
||||
#include "QF/dstring.h"
|
||||
#include "QF/quakefs.h"
|
||||
#include "QF/render.h"
|
||||
#include "QF/screen.h"
|
||||
|
@ -176,16 +177,14 @@ Draw_PicFromWad (const char *name)
|
|||
{
|
||||
glpic_t *gl;
|
||||
qpic_t *p;
|
||||
char *filename;
|
||||
dstring_t *filename = dstring_new ();
|
||||
QFile *f;
|
||||
tex_t *targa;
|
||||
|
||||
|
||||
|
||||
filename = strdup (name);
|
||||
if (!strcmp (filename + strlen(filename) - 4, ".lmp"))
|
||||
strcpy (filename + strlen(filename) - 4, ".tga");
|
||||
QFS_FOpenFile (filename, &f);
|
||||
dsprintf (filename, "%s.tga", name);
|
||||
QFS_FOpenFile (filename->str, &f);
|
||||
dstring_delete (filename);
|
||||
if (f) {
|
||||
targa = LoadTGA (f);
|
||||
Qclose (f);
|
||||
|
|
Loading…
Reference in a new issue