for (format = firstformat;format->formatstring;format++)
{
dpsnprintf (name, sizeof(name), format->formatstring, basename);
- f = FS_LoadFile(name, tempmempool, true, &filesize);
- if (f)
+ if(FS_FileExists(name) && (f = FS_LoadFile(name, tempmempool, true, &filesize)) != NULL)
{
mymiplevel = miplevel ? *miplevel : 0;
image_width = 0;