diff options
author | sluicebox | 2019-07-21 11:26:41 -0700 |
---|---|---|
committer | Filippos Karapetis | 2019-07-21 23:24:53 +0300 |
commit | 1441468855021263c9d6a10475539d3ce69e6755 (patch) | |
tree | 1a6dace54ac29d943cb1269f5b398c47df6e4679 /engines/sci/graphics | |
parent | 286054b857c63cc7b0706eb5acfb85f21ce1e4b2 (diff) | |
download | scummvm-rg350-1441468855021263c9d6a10475539d3ce69e6755.tar.gz scummvm-rg350-1441468855021263c9d6a10475539d3ce69e6755.tar.bz2 scummvm-rg350-1441468855021263c9d6a10475539d3ce69e6755.zip |
SCI: Fix kDrawPic palette validation
Fixes CAMELOT bug #11024
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/picture.cpp | 5 |
1 files 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<const byte> &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<const byte> &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; |