Exit on nullptr returned from decompress callback.

Decompression failures appear to happen (very) occasionally,
resulting in a weird stack trace later down the road.

Bug: None
Change-Id: I12780f462c7d1a141d0841e1e07acb2d282077e4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3970768
Auto-Submit: Roman Lavrov <[email protected]>
Commit-Queue: Amirali Abdolrashidi <[email protected]>
Reviewed-by: Amirali Abdolrashidi <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
This commit is contained in:
Roman Lavrov authored and Angle LUCI CQ committed 2022-10-26 15:37:17 +00:00
1 parent 9b9d8032c1
commit 6bef063034
1 file changed
+5
+5
View File
@@ -67,6 +67,11 @@ void LoadBinaryData(const char *fileName)
std::vector<uint8_t> compressedData(size);
(void)fread(compressedData.data(), 1, size, fp);
gBinaryData = gDecompressCallback(compressedData);
if (gBinaryData == nullptr)
{
// Error already printed by the callback
exit(1);
}
}
else
{