diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx index d6017db55f7a..42be83680f3b 100644 --- a/vcl/generic/glyphs/gcach_ftyp.cxx +++ b/vcl/generic/glyphs/gcach_ftyp.cxx @@ -172,7 +172,12 @@ bool FtFontFile::Map() return false; struct stat aStat; - fstat( nFile, &aStat ); + int nRet = fstat( nFile, &aStat ); + if (nRet < 0) + { + close (nFile); + return false; + } mnFileSize = aStat.st_size; mpFileMap = (const unsigned char*) mmap( NULL, mnFileSize, PROT_READ, MAP_SHARED, nFile, 0 );