coverity#735339 Unchecked return value from library

Change-Id: Ia6567cb6f779669c738469ba68b7ad675e99d71a
This commit is contained in:
Caolán McNamara
2014-01-24 14:11:44 +00:00
parent 6a0f957968
commit 5b0395948e

View File

@@ -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 );