mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-30 20:50:42 +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/console.h"
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
#include "QF/draw.h"
|
#include "QF/draw.h"
|
||||||
|
#include "QF/dstring.h"
|
||||||
#include "QF/quakefs.h"
|
#include "QF/quakefs.h"
|
||||||
#include "QF/render.h"
|
#include "QF/render.h"
|
||||||
#include "QF/screen.h"
|
#include "QF/screen.h"
|
||||||
|
@ -176,16 +177,14 @@ Draw_PicFromWad (const char *name)
|
||||||
{
|
{
|
||||||
glpic_t *gl;
|
glpic_t *gl;
|
||||||
qpic_t *p;
|
qpic_t *p;
|
||||||
char *filename;
|
dstring_t *filename = dstring_new ();
|
||||||
QFile *f;
|
QFile *f;
|
||||||
tex_t *targa;
|
tex_t *targa;
|
||||||
|
|
||||||
|
|
||||||
|
dsprintf (filename, "%s.tga", name);
|
||||||
filename = strdup (name);
|
QFS_FOpenFile (filename->str, &f);
|
||||||
if (!strcmp (filename + strlen(filename) - 4, ".lmp"))
|
dstring_delete (filename);
|
||||||
strcpy (filename + strlen(filename) - 4, ".tga");
|
|
||||||
QFS_FOpenFile (filename, &f);
|
|
||||||
if (f) {
|
if (f) {
|
||||||
targa = LoadTGA (f);
|
targa = LoadTGA (f);
|
||||||
Qclose (f);
|
Qclose (f);
|
||||||
|
|
Loading…
Reference in a new issue