X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=image.c;h=ed498ed6562ce832080410a4fc25a9378aeb4727;hp=ceecd249e999c3bf3998989c21026fb7b4e8da48;hb=e179299248819faf4c25ac6e6360eb6d8246e3e7;hpb=0566b941d50d308409453525212f4467b94a6a04 diff --git a/image.c b/image.c index ceecd249..ed498ed6 100644 --- a/image.c +++ b/image.c @@ -1084,8 +1084,10 @@ 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) + + FS_SanitizePath(name); + + if(FS_FileExists(name) && (f = FS_LoadFile(name, tempmempool, true, &filesize)) != NULL) { mymiplevel = miplevel ? *miplevel : 0; image_width = 0;