aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWalter van Niftrik2009-05-13 23:08:36 +0000
committerWalter van Niftrik2009-05-13 23:08:36 +0000
commit9604e9973643a15d236dbf1f0ca5c470aaabd157 (patch)
tree20ae5f1667239c90c9198d0293d1fb8b16a49a62 /engines
parentab3bd3c3c0a0ccdba55d81fdf5c13b5437bae837 (diff)
downloadscummvm-rg350-9604e9973643a15d236dbf1f0ca5c470aaabd157.tar.gz
scummvm-rg350-9604e9973643a15d236dbf1f0ca5c470aaabd157.tar.bz2
scummvm-rg350-9604e9973643a15d236dbf1f0ca5c470aaabd157.zip
SCI: Fixes a crash when loading SCI1.1 views without palette.
svn-id: r40545
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/gfx/res_view1.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/sci/gfx/res_view1.cpp b/engines/sci/gfx/res_view1.cpp
index 2b0c7439a1..b53702601b 100644
--- a/engines/sci/gfx/res_view1.cpp
+++ b/engines/sci/gfx/res_view1.cpp
@@ -376,8 +376,13 @@ gfxr_view_t *gfxr_draw_view11(int id, byte *resource, int size) {
view->loops_nr = loops_num;
view->loops = (gfxr_loop_t *)calloc(view->loops_nr, sizeof(gfxr_loop_t));
- // There is no indication of size here, but this is certainly large enough
- view->palette = gfxr_read_pal11(id, resource + palette_offset, 1284);
+ if (palette_offset > 0) {
+ // There is no indication of size here, but this is certainly large enough
+ view->palette = gfxr_read_pal11(id, resource + palette_offset, 1284);
+ } else {
+ // View has no palette
+ view->palette = NULL;
+ }
seeker = resource + header_size;
for (i = 0; i < view->loops_nr; i++) {