X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=image.c;h=9f07ce60f174a955f89474114062eb19bb8358eb;hb=66994a596c89b53c9d78566b4022cc9cf6e1f1a6;hp=ceecd249e999c3bf3998989c21026fb7b4e8da48;hpb=0566b941d50d308409453525212f4467b94a6a04;p=xonotic%2Fdarkplaces.git diff --git a/image.c b/image.c index ceecd249..9f07ce60 100644 --- a/image.c +++ b/image.c @@ -1084,8 +1084,7 @@ unsigned char *loadimagepixelsbgra (const char *filename, qbool complain, qbool 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;