Opened 2 months ago

Last modified 2 months ago

#15539 new defect

SCUMM: HE: Assertion error crash in Spy Fox 2 "Things From Space" minigame

Reported by: joeraz Owned by:
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Spy Fox 2

Description

Hello,

I'm running into an issue where ScummVM crashes while I'm playing the spy watch minigame in Spy Fox 2: "Things From Space". This crash seems to occur if I die on level 6 of the game. I've died in earlier levels, and the game continues as normal. According to the console, the crash is due to an assertion error, though the console goes away too quickly before I can capture any more detail.

I've had this happen in the 2.9 prelease, 2.8, and some prior versions as well (it's been happening for a few versions - I thought it was reported before, but can't find any bug report). I've tested in both Windows 10 and 11.

Change History (2)

comment:1 by sev-, 2 months ago

Summary: Assertion error crash in Spy Fox 2 "Things From Space" minigameSCUMM: HE: Assertion error crash in Spy Fox 2 "Things From Space" minigame

comment:2 by AndywinXp, 2 months ago

Great find! This happens because the game is trying to load a bunch of images which have resource id equal to 0. This is allowed in the original and effectively yields a valid image file.

We disallow it because of this piece of code in ScummEngine::ensureResourceLoaded():

	// FIXME: This check used to be "idx==0". However, that causes
	// problems when using this function to ensure charset 0 is loaded.
	// This is done for many games, e.g. Zak256 or Indy3 (EGA and VGA).
	// For now we restrict the check to anything which is not a charset.
	// Question: Why was this check like that in the first place?
	// Answer: costumes with an index of zero in the newer games at least.
	// TODO: determine why the heck anything would try to load a costume
	// with id 0. Is that "normal", or is it caused by yet another bug in
	// our code base? After all we also have to add special cases for many
	// of our script opcodes that check for the (invalid) actor 0... so
	// maybe both issues are related...
	if (type != rtCharset && idx == 0)
		return;

It's not clear to me why this piece of code is here... I'll investigate and then let you know.

Last edited 2 months ago by AndywinXp (previous) (diff)
Note: See TracTickets for help on using tickets.