[ scummvm-Bugs-1253171 ] ZAK: Invalid memory read access during intro

SourceForge.net noreply at sourceforge.net
Sat Aug 6 16:23:41 CEST 2005


Bugs item #1253171, was opened at 2005-08-06 16:23
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418820&aid=1253171&group_id=37116

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Unknown Crash/Other
Group: Zak McCracken (EGA)
Status: Open
Resolution: None
Priority: 5
Submitted By: Torbjörn Andersson (eriktorbjorn)
Assigned to: Nobody/Anonymous (nobody)
Summary: ZAK: Invalid memory read access during intro

Initial Comment:
Latest ScummVM CVS snapshot
English V2 Enhanced version of Zak McKracken

During the intro of the game, Valgrind will warn about
invalid read access in Player_V2::execute_cmd(). This
appears to be because the sound resource for the intro
song is being nuked and reloaded while the music is
playing. (This happens at the point in the intro where
Zak sees himself.)

Inserting a trivial test, such as this, into
createResource() appears to fix the immediate problem:

    if (type == rtSound && isResourceLoaded(type, idx))
        return address[type][idx] + sizeof(MemBlkHeader);

But this does not seem particularly elegant to me.
While sound resources should stay the same throughout
the game, I image there may be cases where a game
really does want to "reset" a resource by reloading it.

For whatever it's worth, the resource is locked at the
time so perhaps the test can be generalized into
something like this instead:

    if (isResourceLoaded(type, idx) &&
(flags[type][idx] & RF_LOC))
        return address[type][idx] + sizeof(MemBlkHeader);

But is this what resource locking is for? I don't know
enough about the resource management...

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418820&aid=1253171&group_id=37116




More information about the Scummvm-tracker mailing list