[Scummvm-tracker] [ScummVM :: Bugs] #15507: SCUMM: FT: ScummEngine_v7::displayDialog() copies random garbage to _charsetColorMap

ScummVM :: Bugs trac at scummvm.org
Sun Nov 17 17:08:18 UTC 2024


#15507: SCUMM: FT: ScummEngine_v7::displayDialog() copies random garbage to
_charsetColorMap
--------------------------+---------------------------
Reporter:  eriktorbjorn   |      Owner:  (none)
    Type:  defect         |     Status:  new
Priority:  normal         |  Component:  Engine: SCUMM
 Version:                 |   Keywords:
    Game:  Full Throttle  |
--------------------------+---------------------------
 I've been trying to hunt down the cause of Valgrind warnings about
 uninitialized data when saving in Full Throttle, and I finally think I see
 what happens, even if I still don't know why.

 If I start Full Throttle and skip by the intro cutscenes, it ends up
 calling `ScummEngine_v7::displayDialog()` while `_charset->getCurID()` is
 -1. That means that this code:

 {{{
         if (_game.version == 7)
                 memcpy(_charsetColorMap,
 _charsetData[_charset->getCurID()], _game.id == GID_DIG ?
 sizeof(_charsetColorMap) : 4);
 }}}

 will print whatever is in memory before `_charsetData` to
 `_charsetColorMap`. The same code also appears in
 `ScummEngine_v7::drawBlastTexts()` but I don't know if it too can copy
 random data.

 I think this has the potential to be serious enough to warrant a fix
 before 2.9.0, but I'll admit that this is just a gut feeling.
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/15507>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list