diff options
author | Filippos Karapetis | 2010-07-02 08:53:51 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-07-02 08:53:51 +0000 |
commit | b252d5f0b97e229e73ed1c63b48d8c2e7896775a (patch) | |
tree | 754831683d561c88b7ee620797b1f6d026ef4ff6 /engines/sci/engine/seg_manager.cpp | |
parent | 8b0f49b801afbef5ae2523078e82963c1120b3f5 (diff) | |
download | scummvm-rg350-b252d5f0b97e229e73ed1c63b48d8c2e7896775a.tar.gz scummvm-rg350-b252d5f0b97e229e73ed1c63b48d8c2e7896775a.tar.bz2 scummvm-rg350-b252d5f0b97e229e73ed1c63b48d8c2e7896775a.zip |
getString() on a NULL pointer is an empty string (verified in SCI2.1)
svn-id: r50591
Diffstat (limited to 'engines/sci/engine/seg_manager.cpp')
-rw-r--r-- | engines/sci/engine/seg_manager.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index 135ad38792..339920936f 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -789,6 +789,9 @@ size_t SegManager::strlen(reg_t str) { Common::String SegManager::getString(reg_t pointer, int entries) { Common::String ret; + if (pointer.isNull()) + return ret; // empty text + SegmentRef src_r = dereference(pointer); if (!src_r.isValid()) { warning("SegManager::getString(): Attempt to dereference invalid pointer %04x:%04x", PRINT_REG(pointer)); |