GUI: Don't continue when PNGDecoder fails to load file
This commit is contained in:
parent
dda3c8f342
commit
6d256a4b44
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue