id,summary,reporter,owner,description,type,status,priority,component,version,resolution,keywords,cc,game 2115,ZAK: Invalid memory read access during intro,eriktorbjorn,eriktorbjorn,"{{{#!Markdown 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... }}} {{{#!div style=""font-size: 75%"" Ticket imported from: !#1253171. Ticket imported from: bugs/2115. }}}",defect,closed,normal,Engine: SCUMM,,fixed,,,Zak McKracken