[Scummvm-tracker] [ScummVM :: Bugs] #14468: SCUMM: SAMNMAX: copyRectToSurface() assert triggered in 2.8.0git when loading a save

ScummVM :: Bugs trac at scummvm.org
Tue May 16 18:47:10 UTC 2023


#14468: SCUMM: SAMNMAX: copyRectToSurface() assert triggered in 2.8.0git when
loading a save
------------------------+---------------------------------------------
Reporter:  dwatteau     |      Owner:  (none)
    Type:  defect       |     Status:  new
Priority:  normal       |  Component:  Engine: SCUMM
 Version:               |   Keywords:  copyRectToSurface,cursor,assert
    Game:  Sam and Max  |
------------------------+---------------------------------------------
 In current ScummVM 2.8.0git, loading the attached Sam & Max savegame from
 the GMM triggers the following assert(), when running from a debug build:

 {{{
 scummvm: graphics/surface.cpp:169: void
 Graphics::Surface::copyRectToSurface(const void*, int, int, int, int,
 int): Assertion `destX >= 0 && destX < w' failed.

 (gdb) bt
 #0  __pthread_kill_implementation (threadid=<optimized out>,
 signo=signo at entry=6, no_tid=no_tid at entry=0) at ./nptl/pthread_kill.c:44
 #1  0x00007ffff75cad2f in __pthread_kill_internal (signo=6,
 threadid=<optimized out>) at ./nptl/pthread_kill.c:78
 #2  0x00007ffff757bef2 in __GI_raise (sig=sig at entry=6) at
 ../sysdeps/posix/raise.c:26
 #3  0x00007ffff7566472 in __GI_abort () at ./stdlib/abort.c:79
 #4  0x00007ffff7566395 in __assert_fail_base (fmt=0x7ffff76daa70
 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
     assertion=assertion at entry=0x555555b41437 "destX >= 0 && destX < w",
 file=file at entry=0x555555b413a3 "graphics/surface.cpp",
 line=line at entry=169,
     function=function at entry=0x555555b413e0 "void
 Graphics::Surface::copyRectToSurface(const void*, int, int, int, int,
 int)") at ./assert/assert.c:92
 #5  0x00007ffff7574df2 in __GI___assert_fail (assertion=0x555555b41437
 "destX >= 0 && destX < w", file=0x555555b413a3 "graphics/surface.cpp",
     line=169, function=0x555555b413e0 "void
 Graphics::Surface::copyRectToSurface(const void*, int, int, int, int,
 int)") at ./assert/assert.c:101
 #6  0x0000555555943aae in Graphics::Surface::copyRectToSurface
 (this=0x5555570ba070, buffer=0x555556cf887c, srcPitch=0, destX=0, destY=0,
 width=0,
     height=0) at graphics/surface.cpp:169
 #7  0x0000555555943c9e in Graphics::Surface::copyRectToSurface
 (this=0x5555570ba070, srcSurface=..., destX=0, destY=0, subRect=...)
     at graphics/surface.cpp:183
 #8  0x00005555558fbd1a in Graphics::CursorManager::replaceCursor
 (this=0x555556b7a370, surf=..., hotspotX=0, hotspotY=0, keycolor=255,
     dontScale=false, mask=0x0) at graphics/cursorman.cpp:169
 #9  0x00005555558fbb1b in Graphics::CursorManager::replaceCursor
 (this=0x555556b7a370, buf=0x555556cf887c, w=0, h=0, hotspotX=0,
 hotspotY=0,
     keycolor=255, dontScale=false, format=0x7fffffffbca3, mask=0x0) at
 graphics/cursorman.cpp:138
 #10 0x00005555556baf89 in Scumm::ScummEngine::updateCursor
 (this=0x555556cefbe0) at engines/scumm/cursor.cpp:260
 #11 0x00005555556679a9 in Scumm::ScummEngine::saveLoadWithSerializer
 (this=0x555556cefbe0, s=...) at engines/scumm/saveload.cpp:1559
 #12 0x0000555555663ded in Scumm::ScummEngine::loadState
 (this=0x555556cefbe0, slot=2, compat=false, filename=...) at
 engines/scumm/saveload.cpp:730
 #13 0x0000555555663802 in Scumm::ScummEngine::loadState
 (this=0x555556cefbe0, slot=2, compat=false) at
 engines/scumm/saveload.cpp:597
 #14 0x00005555556775da in Scumm::ScummEngine::go (this=0x555556cefbe0) at
 engines/scumm/scumm.cpp:2325
 #15 0x000055555567c638 in Scumm::ScummEngine::run (this=0x555556cefbe0) at
 ./engines/scumm/scumm.h:574
 #16 0x0000555555638f47 in runGame (plugin=0x555555cf9bd0,
 enginePlugin=0x555555ce3d50, system=..., debugLevels=...) at
 base/main.cpp:318
 #17 0x000055555563af1f in scummvm_main (argc=1, argv=0x7fffffffe138) at
 base/main.cpp:758
 #18 0x00005555556364ce in main (argc=1, argv=0x7fffffffe138) at
 backends/platform/sdl/posix/posix-main.cpp:44
 }}}

 This is with the French release of Sam & Max (sorry, that's all I have on
 this computer, but it's available on GOG, and I can create a new save with
 the English release in a couple of days if required). I just played the
 game until meeting Doug for the first time, and I saved there (I'm using
 `original_gui=true`).

 The issue doesn't happen in ScummVM 2.7.0. Git bisect tells me that the
 problem appeared with commit `dd1232325d9b310a85244f78ca5d12c063cf047f`
 ("GRAPHICS: Add support for cursor as Surface").

 I can't say if the issue comes from the SCUMM engine, or from the new
 graphics code.
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/14468>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list