Opened 6 months ago

Closed 6 months ago

#14617 closed defect (fixed)

ACCESS: Failed assertion in copyRectToSurface() when dragging inventory item (Amazon: GoE)

Reported by: PushmePullyu Owned by: PushmePullyu
Priority: normal Component: Engine: Access
Version: Keywords:
Cc: PushmePullyu Game: Amazon: Guardians of Eden

Description

Tested with 645230091f29ddcb73474cd820581e5f739afa15 on Linux x86_64 using the US DOS CD version of Amazon: Guardians of Eden.

When dragging an item to the right or bottom edge of the screen in inventory view the game terminates. Message for the right edge case:

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

The reason for the crash is this code in engines/access/inventory.cpp:
in combineItems():

Common::Rect lastRect(lastBox.x, lastBox.y, lastBox.x + 46, lastBox.y + 35);
screen.copyBlock(&_vm->_buffer2, lastRect);

Due to the addition, lastRect can be out of bounds of the screen surface.

To reproduce:

  1. Start a new game
  2. Click on the backpack icon to open the inventory
  3. Drag the car keys to the right or bottom edge of the screen

Change History (2)

comment:1 by PushmePullyu, 6 months ago

Owner: set to PushmePullyu
Resolution: pending
Status: newpending

comment:2 by bluegr, 6 months ago

Resolution: pendingfixed
Status: pendingclosed

Thanks for your work on this. The PR has been merged

Note: See TracTickets for help on using tickets.