From 645e6baa07e71d10b76f3f0fd0950c2e0513a23c Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 16 Jul 2009 12:43:42 +0000 Subject: Added a proper fix for Pepper (the previous one caused regressions in KQ6) svn-id: r42533 --- engines/sci/gfx/res_pal.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/sci/gfx/res_pal.cpp') diff --git a/engines/sci/gfx/res_pal.cpp b/engines/sci/gfx/res_pal.cpp index 97e7297d43..d686220453 100644 --- a/engines/sci/gfx/res_pal.cpp +++ b/engines/sci/gfx/res_pal.cpp @@ -44,6 +44,11 @@ Palette *gfxr_read_pal11(int id, byte *resource, int size) { int entry_size = (format == SCI_PAL_FORMAT_VARIABLE_FLAGS) ? 4 : 3; byte *pal_data = resource + 37; int _colors_nr = READ_LE_UINT16(resource + 29); + + // Happens at the beginning of Pepper + if (_colors_nr > 256) + return NULL; + Palette *retval = new Palette(_colors_nr + start_color); int i; -- cgit v1.2.3