[Scummvm-tracker] [ScummVM :: Bugs] #15600: PEGASUS: Possible bug in Cursor::loadCursorImage()

ScummVM :: Bugs trac at scummvm.org
Tue Dec 17 09:12:33 UTC 2024


#15600: PEGASUS: Possible bug in Cursor::loadCursorImage()
---------------------------------------------+-----------------------------
Reporter:  eriktorbjorn                      |      Owner:  (none)
    Type:  defect                            |     Status:  new
Priority:  normal                            |  Component:  Engine: Pegasus
 Version:                                    |   Keywords:
    Game:  Journeyman Project Pegasus Prime  |
---------------------------------------------+-----------------------------
 I don't know where this happens, but I was looking at the Pegasus engine's
 `Cursor::loadCursorImage()` for reference and noticed this:

 {{{
         // Mask section
         cicnStream->readUint32BE(); // mask baseAddr
         uint16 maskRowBytes = cicnStream->readUint16BE(); // mask rowBytes
         cicnStream->skip(3 * 2); // mask rect
         /* uint16 maskHeight = */ cicnStream->readUint16BE();

         // Bitmap section
         cicnStream->readUint32BE(); // baseAddr
         uint16 rowBytes = cicnStream->readUint16BE();
         cicnStream->readUint16BE(); // top
         cicnStream->readUint16BE(); // left
         uint16 height = cicnStream->readUint16BE(); // bottom
         cicnStream->readUint16BE(); // right

         // Data section
         cicnStream->readUint32BE(); // icon handle
         cicnStream->skip(maskRowBytes * height); // FIXME: maskHeight
 doesn't work here, though the specs say it should
         cicnStream->skip(rowBytes * height);
 }}}

 It's using `height` to skip the mask because "`maskHeight`  doesn't work
 here". But it would have read `maskHeight` from the ''last'' field in the
 mask rect. Judging by how it reads `height`, it should have used the
 ''third'' field, because the fourth one would be the ''width'', wouldn't
 it? (Assuming the top and left fields are both zero.)
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/15600>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list