From 1441468855021263c9d6a10475539d3ce69e6755 Mon Sep 17 00:00:00 2001 From: sluicebox Date: Sun, 21 Jul 2019 11:26:41 -0700 Subject: SCI: Fix kDrawPic palette validation Fixes CAMELOT bug #11024 --- engines/sci/graphics/picture.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 3ae1fd06fb..96c6e98595 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -424,7 +424,6 @@ void GfxPicture::drawVectorData(const SciSpan &data) { byte pic_priority = 255, pic_control = 255; int16 x = 0, y = 0, oldx, oldy; byte EGApalettes[PIC_EGAPALETTE_TOTALSIZE] = {0}; - byte *EGApalette = &EGApalettes[_EGApaletteNo * PIC_EGAPALETTE_SIZE]; byte EGApriority[PIC_EGAPRIORITY_SIZE] = {0}; bool isEGA = false; uint curPos = 0; @@ -438,8 +437,10 @@ void GfxPicture::drawVectorData(const SciSpan &data) { memset(&palette, 0, sizeof(palette)); - if (_EGApaletteNo >= PIC_EGAPALETTE_COUNT) + if (_EGApaletteNo >= PIC_EGAPALETTE_COUNT) { _EGApaletteNo = 0; + } + byte *EGApalette = &EGApalettes[_EGApaletteNo * PIC_EGAPALETTE_SIZE]; if (_resMan->getViewType() == kViewEga) { isEGA = true; -- cgit v1.2.3