GRIM: Check for success in loading material.

Fixes COVERITY: 1433524
This commit is contained in:
Einar Johan Trøan Sømåen 2022-10-02 01:13:10 +02:00
parent 18a34fc9be
commit 1eb48aa90a
No known key found for this signature in database
GPG Key ID: 0DFF2FB496CF9F93

View File

@ -454,6 +454,8 @@ Material *ResourceLoader::loadMaterial(const Common::String &filename, CMap *c,
error("Could not find material %s", filename.c_str());
}
}
if (!stream)
error("Couldn't open %s", fname.c_str());
Material *result = new Material(fname, stream, c, clamp);
delete stream;