Opened 8 years ago

Closed 7 years ago

#9733 closed patch (fixed)

KYRA1: Crash: engines/kyra/screen_lok.cpp:77: void Kyra::Screen_LoK::fadeSpecialPalette(int, int, int, int): Assertion `_vm->palTable1()[palIndex]' failed.

Reported by: sergesv Owned by: csnover
Priority: blocker Component: Engine: Kyra
Version: Keywords: has-save-game has-patch
Cc: Game: Kyrandia 1

Description

Tested in scummvm 1.5.0/1.7.0/1.9.0 on linux/android.

KyraEngine_LoK::seq_playEnd() calls fadeSpecialPalette(32, 228, 20, 60), which for palIndex=32 uses k1SpecialPalette33, which is not provided for OLDFLOPPY flags (could be a copy-paste error), and crashes ScummVM. Attached patch fixes that.

Steps to reproduce:
OLDFLOPPY is used for russian translation, so it's the easiest way to test:

  1. Get unpacked Legend of Kyrandia floppies
  2. Apply russian translation (http://katkov.net/Kyrandia/dl/kyrand1r.exe can be unpacked with 7-zip)
  3. Play until the kyragem room. Or just load a savegame (attached)
  4. Put scepter in place. Watch you talking to Malkolm, walking into kyragem room
  5. Stand in front of the mirror on the right side of the room, and become invisible by pressing the big red gem in the bottom right corner of the screen. Watch Malcolm spell reflecting from the mirror and see what happens next.

Expected result:
Something good.

Actual result:
ScummVM crashes:
scummvm: engines/kyra/screen_lok.cpp:77: void Kyra::Screen_LoK::fadeSpecialPalette(int, int, int, int): Assertion `_vm->palTable1()[palIndex]' failed.

(gdb) bt
#0  0xb7b20417 in raise () from /lib/i386-linux-gnu/libc.so.6
#1  0xb7b23802 in abort () from /lib/i386-linux-gnu/libc.so.6
#2  0xb7b19617 in __assert_fail () from /lib/i386-linux-gnu/libc.so.6
#3  0x0809c3aa in Kyra::Screen_LoK::fadeSpecialPalette (this=0x85e0908, palIndex=32, startIndex=228, size=20, fadeTime=60) at engines/kyra/screen_lok.cpp:77
#4  0x080d20a2 in Kyra::KyraEngine_LoK::seq_playEnd (this=0x85dae50) at engines/kyra/sequences_lok.cpp:1090
#5  0x08062c7e in Kyra::KyraEngine_LoK::mainLoop (this=0x85dae50) at engines/kyra/kyra_lok.cpp:444
#6  0x08062417 in Kyra::KyraEngine_LoK::go (this=0x85dae50) at engines/kyra/kyra_lok.cpp:336
#7  0x0806494d in Kyra::KyraEngine_v1::run (this=0x85dae50) at ./engines/kyra/kyra_v1.h:255
#8  0x08050d8f in runGame (plugin=0x847df38, system=..., edebuglevels=...) at base/main.cpp:260
#9  0x08051db9 in scummvm_main (argc=4, argv=0xbffffba4) at base/main.cpp:522
#10 0x0804f288 in main (argc=4, argv=0xbffffba4) at backends/platform/sdl/posix/posix-main.cpp:45

Suggested solution:
I copy-pasted k1SpecialPalette33 from lok_dos_english.h to lok_dos_oldfloppy.h (patch attached), and regenerated kyra.dat (attached).

Attachments (3)

kyra1-ru.032 (14.1 KB ) - added by sergesv 8 years ago.
Savegame just before the crash
scummvm-1.9.0-crashfix.patch (2.9 KB ) - added by sergesv 8 years ago.
kyra.dat.updated (485.0 KB ) - added by sergesv 8 years ago.

Download all attachments as: .zip

Change History (7)

by sergesv, 8 years ago

Attachment: kyra1-ru.032 added

Savegame just before the crash

by sergesv, 8 years ago

by sergesv, 8 years ago

Attachment: kyra.dat.updated added

comment:1 by csnover, 7 years ago

Keywords: crash patch removed
Priority: normalblocker

comment:2 by csnover, 7 years ago

Keywords: has-save-game has-patch added

comment:3 by csnover, 7 years ago

Owner: set to csnover

Thanks for your report and patch! Your patch for this issue has been added in commit cf61174396cdbbf371cb26bac753a190277da6e5 and will be available in daily builds 1.10.0git-5488 and later.

comment:4 by csnover, 7 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.