aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorrichiesams2013-08-09 14:52:21 -0500
committerrichiesams2013-08-09 14:52:21 -0500
commitf89120310cd08dc0640b51ed1e49dd02c3a028b9 (patch)
tree8a5157e8b81a02b35336e95e124f82d287e55f9d /engines/zvision
parent0feac806b235867aae4078d2b5c58c38b3b23e21 (diff)
downloadscummvm-rg350-f89120310cd08dc0640b51ed1e49dd02c3a028b9.tar.gz
scummvm-rg350-f89120310cd08dc0640b51ed1e49dd02c3a028b9.tar.bz2
scummvm-rg350-f89120310cd08dc0640b51ed1e49dd02c3a028b9.zip
ZVISION: Test for file.open before trying to read
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/utility.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/zvision/utility.cpp b/engines/zvision/utility.cpp
index 2e1ade663a..fb4fe22ff8 100644
--- a/engines/zvision/utility.cpp
+++ b/engines/zvision/utility.cpp
@@ -33,7 +33,10 @@ namespace ZVision {
void writeFileContentsToFile(const Common::String &sourceFile, const Common::String &destFile) {
Common::File f;
- f.open(sourceFile);
+ if (!f.open(sourceFile)) {
+ return;
+ }
+
byte* buffer = new byte[f.size()];
f.read(buffer, f.size());