aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2011-06-10 22:30:03 +0200
committerMax Horn2011-06-10 22:30:03 +0200
commit7ab553d72a14c04be1aa7e787eeef360be7bb619 (patch)
tree6dab43d7ddcf7b2f128f27e446f97e1e0ddbe7de /common
parenteea6f69b595be9c95f7af0f79086e0cb05fb8fa4 (diff)
downloadscummvm-rg350-7ab553d72a14c04be1aa7e787eeef360be7bb619.tar.gz
scummvm-rg350-7ab553d72a14c04be1aa7e787eeef360be7bb619.tar.bz2
scummvm-rg350-7ab553d72a14c04be1aa7e787eeef360be7bb619.zip
COMMON: Do not try to read from res forks of non-existant files
Diffstat (limited to 'common')
-rw-r--r--common/macresman.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/common/macresman.cpp b/common/macresman.cpp
index 6cbc08da19..c1cab8b96a 100644
--- a/common/macresman.cpp
+++ b/common/macresman.cpp
@@ -107,14 +107,17 @@ bool MacResManager::open(String filename) {
#ifdef MACOSX
// Check the actual fork on a Mac computer
String fullPath = ConfMan.get("path") + "/" + filename + "/..namedfork/rsrc";
- SeekableReadStream *macResForkRawStream = FSNode(fullPath).createReadStream();;
+ FSNode resFsNode = FSNode(fullPath);
+ if (resFsNode.exists()) {
+ SeekableReadStream *macResForkRawStream = resFsNode.createReadStream();;
- if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
- _baseFileName = filename;
- return true;
- }
+ if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
+ _baseFileName = filename;
+ return true;
+ }
- delete macResForkRawStream;
+ delete macResForkRawStream;
+ }
#endif
File *file = new File();
@@ -167,14 +170,17 @@ bool MacResManager::open(FSNode path, String filename) {
#ifdef MACOSX
// Check the actual fork on a Mac computer
String fullPath = path.getPath() + "/" + filename + "/..namedfork/rsrc";
- SeekableReadStream *macResForkRawStream = FSNode(fullPath).createReadStream();
+ FSNode resFsNode = FSNode(fullPath);
+ if (resFsNode.exists()) {
+ SeekableReadStream *macResForkRawStream = resFsNode.createReadStream();;
- if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
- _baseFileName = filename;
- return true;
- }
+ if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
+ _baseFileName = filename;
+ return true;
+ }
- delete macResForkRawStream;
+ delete macResForkRawStream;
+ }
#endif
// First, let's try to see if the Mac converted name exists