GUI: Don't continue when PNGDecoder fails to load file

This commit is contained in:
av-dx 2021-07-28 00:03:03 +05:30 committed by Eugene Sandulenko
parent dda3c8f342
commit 6d256a4b44

View file

@ -292,8 +292,10 @@ Graphics::ManagedSurface *loadSurfaceFromFile(const Common::String &name) {
Common::FSNode fileNode(path);
Common::SeekableReadStream *stream = fileNode.createReadStream();
if (stream) {
if (!decoder.loadStream(*stream))
if (!decoder.loadStream(*stream)) {
warning("Error decoding PNG");
return surf;
}
srcSurface = decoder.getSurface();
delete stream;