Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#5922 closed defect (fixed)

TINSEL: DW Crash in Subtitle Menu

Reported by: misterhands Owned by: bluegr
Priority: high Component: Engine: Tinsel
Keywords: Cc:
Game: Discworld


When I click in the subtitles menu on the subtitles speed slider, and then hit the OK button, SCUMMVM crashes on me,
and gives the following error message :

Assertion failed: ((unsigned int) lang) < NUM_LANGUAGES, file engines/tinsel/tinsel.cpp, line 1266

I have the multilang GRA files version of Discworld, and use SCUMMVM 1.4 Win32.

Thanks !

Ticket imported from: #3459999. Ticket imported from: bugs/5922.

Attachments (1)

DISCWLD.md5 (9.1 KB) - added by misterhands 8 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 8 years ago by lordhoto

It would be nice to know what language you selected in your ScummVM configuration.

comment:2 Changed 8 years ago by lordhoto

Summary: Discworld menu crashDW: menu crash

comment:3 Changed 8 years ago by misterhands

You got it : its French !

comment:4 Changed 8 years ago by dreammaster

I'd make a guess that since the assert is explicitly checking that the unsigned value of the passed language (Tinsel language list, not Common) against NUM_LANGUAGES value, it's either getting a value of 'UNK_LANG', or a language value not actually supported by the Tinsel engine. Though French at least is one of the explicitly supported languages, so I'm not sure why it would assert out like this.

comment:5 Changed 8 years ago by dreammaster

Actually, maybe not. Passed languages are only meant to be one of the valid values of the LANGUAGE enum anyway. So I'm not sure why an invalid value would be passed to the method. I think it'll take a developer with the French version to backtrack to see where the invalid language gets passed from, and if it's from the _language global, how it got set to an invalid value.

comment:6 Changed 8 years ago by digitall

misterhands: Thanks for this bug report. To ensure that we can identify your exact version, could you please attach a listing (and preferably MD5sums) of your Discworld datafiles as a text file to this bug?
The output of a tool such as would be optimal.

Changed 8 years ago by misterhands

Attachment: DISCWLD.md5 added

comment:7 Changed 8 years ago by misterhands

OK here's the file you requested.
I don't think my version of Discworld is particularly rare or exotic though, but I could be wrong...

comment:8 Changed 8 years ago by digitall

Summary: DW: menu crashTINSEL: DW Crash in Subtitle Menu

comment:9 Changed 8 years ago by digitall

misterhands: Thanks for the attached file. The format is perfect.

Your multilanguage version is probably not rare or exotic, but it helps to have file listing with full MD5s for the developer who investigates to know your exact version, exclude any crashes due to corrupted files from defective, old or scratched media and to be sure that you don't have an odd variant (some translations were bad for file naming oddities).

I have compared this to my DW1 version, but I have the UK version with SCN files, so can't look at investigating this myself...

comment:10 Changed 7 years ago by sev-

This bug is nice to get fixed before the release. Raising priority for keeping the track.

comment:11 Changed 7 years ago by sev-

Owner: set to dreammaster
Priority: normalhigh

comment:12 Changed 7 years ago by bluegr

This bug occurs when changing the slider without selecting a language flag.

In this case, InvDragStart() sets whichbox via WhichMenuBox(), which returns a very large value. Then, it sets cd.selBox to this very high value. Then, LanguageChange() does this:
nLang = (LANGUAGE)(cd.selBox + 1);
...which sets nLang to a very high value.

Thus, the bug here is with WhichMenuBox(), and the subsequent value set in cd.selBox.

In dialogs.cpp, there are some negative values for special widgets (IB_UP etc). Perhaps selBox should always be positive?

comment:13 Changed 7 years ago by dreammaster

Thanks for the analysis md5. Unfortunately, as per previously, since this is a frequently used function, and I don't have a copy of the multi-lingual version, I'm not confident to do any fixes without anything to test against. I'm reassigning this back to None.

comment:14 Changed 7 years ago by dreammaster

Owner: dreammaster deleted

comment:15 Changed 7 years ago by bluegr

Tested with my multilanguage version of DW1.

Fixed in r4c3b483 (master) and r13607b0 (branch 1.5)

comment:16 Changed 7 years ago by bluegr

Owner: set to bluegr
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.