|
@@ -944,12 +944,22 @@ bool ReadFile(const Path &inPath, void *&outData, U32 &outSize, bool inNullTermi
|
|
if ( inNullTerminate )
|
|
if ( inNullTerminate )
|
|
{
|
|
{
|
|
outData = new char [outSize+1];
|
|
outData = new char [outSize+1];
|
|
|
|
+ if( !outData )
|
|
|
|
+ {
|
|
|
|
+ // out of memory
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
sizeRead = fileR->read(outData, outSize);
|
|
sizeRead = fileR->read(outData, outSize);
|
|
static_cast<char *>(outData)[outSize] = '\0';
|
|
static_cast<char *>(outData)[outSize] = '\0';
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
outData = new char [outSize];
|
|
outData = new char [outSize];
|
|
|
|
+ if( !outData )
|
|
|
|
+ {
|
|
|
|
+ // out of memory
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
sizeRead = fileR->read(outData, outSize);
|
|
sizeRead = fileR->read(outData, outSize);
|
|
}
|
|
}
|
|
|
|
|