aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sword1/resman.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/sword1/resman.cpp b/engines/sword1/resman.cpp
index 878ba8eceb..3e8ee93c52 100644
--- a/engines/sword1/resman.cpp
+++ b/engines/sword1/resman.cpp
@@ -227,7 +227,8 @@ Header *ResMan::lockScript(uint32 scrID) {
#else
openScriptResourceLittleEndian(scrID);
#endif
- return (Header *)resHandle(scrID)->data;
+ MemHandle *handle = resHandle(scrID);
+ return handle != NULL ? (Header *)handle->data : NULL;
}
void ResMan::unlockScript(uint32 scrID) {
@@ -343,8 +344,8 @@ MemHandle *ResMan::resHandle(uint32 id) {
uint8 cluster = (uint8)((id >> 24) - 1);
uint8 group = (uint8)(id >> 16);
- // There is a know case of reading beyond array boundaries when trying to use
- // portuguese subtitles (cluster file 2, group 6) with a version that do not
+ // There is a known case of reading beyond array boundaries when trying to use
+ // portuguese subtitles (cluster file 2, group 6) with a version that does not
// contain subtitles for this languages (i.e. has only 6 languages and not 7).
if (cluster >= _prj.noClu || group >= _prj.clu[cluster].noGrp)
return NULL;