aboutsummaryrefslogtreecommitdiff
path: root/engines/chewy/text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/chewy/text.cpp')
-rw-r--r--engines/chewy/text.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/chewy/text.cpp b/engines/chewy/text.cpp
index cf0fb041a7..095b74b290 100644
--- a/engines/chewy/text.cpp
+++ b/engines/chewy/text.cpp
@@ -112,8 +112,14 @@ TextEntry *Text::getText(uint dialogNum, uint entryNum) {
}
} while (*ptr);
- if (*(ptr + 1) != kEndText || *(ptr + 2) != kEndChunk)
- error("Invalid text resource - %d, %d", dialogNum, entryNum);
+ if (*(ptr + 1) != kEndText || *(ptr + 2) != kEndChunk) {
+ warning("Invalid text resource - %d, %d", dialogNum, entryNum);
+
+ delete[] data;
+ delete d;
+
+ return nullptr;
+ }
if (!isText)
ptr += 3; // 0, kEndText, kEndChunk