Handle exceptions in VFS C API.
PiperOrigin-RevId: 817688877 Change-Id: Ia2e306fe4cd1848eb5731212aa4e959080a9d377
This commit is contained in:
committed by
Copybara-Service
parent
b63252e4bb
commit
9e0885a4fa
@@ -1140,7 +1140,13 @@ std::vector<uint8_t> FileToMemory(const char* filename) {
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<uint8_t> buffer(long_filesize);
|
||||
std::vector<uint8_t> buffer;
|
||||
try {
|
||||
buffer.resize(long_filesize);
|
||||
} catch (...) {
|
||||
fclose(fp);
|
||||
return {};
|
||||
}
|
||||
|
||||
// go back to start of file
|
||||
if (fseek(fp, 0, SEEK_SET) != 0) {
|
||||
|
||||
Reference in New Issue
Block a user