From f89120310cd08dc0640b51ed1e49dd02c3a028b9 Mon Sep 17 00:00:00 2001 From: richiesams Date: Fri, 9 Aug 2013 14:52:21 -0500 Subject: ZVISION: Test for file.open before trying to read --- engines/zvision/utility.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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()); -- cgit v1.2.3