Opened 9 years ago

Closed 9 years ago

#5939 closed defect (fixed)

TSAGE: BF: Crash when trying to reload gun in boat

Reported by: tsoliman Owned by: dreammaster
Priority: normal Component: Engine: TsAGE
Keywords: Cc:
Game: Blue Force

Description

scummvm: ../engines/tsage/resources.cpp:403: byte* TsAGE::TLib::getSubResource(int, int, int, uint*, bool): Assertion `*size < (1024 * 1024)' failed.

Steps to reproduce: load attached savegame use gun on boat (empty the clip) click the ammo belt in inventory CRASH!

Linux adb534

Ticket imported from: #3467505. Ticket imported from: bugs/5939.

Attachments (1)

blueforce-cd.009 (20.5 KB ) - added by tsoliman 9 years ago.
SAVEGAME

Download all attachments as: .zip

Change History (8)

by tsoliman, 9 years ago

Attachment: blueforce-cd.009 added

SAVEGAME

comment:1 by digitall, 9 years ago

Replicated on Linux x86_32 with latest Git master. Backtrace attached: #4 0x0808757e in TsAGE::TLib::getSubResource (this=0xb6bb0830, resNum=9, rlbNum=6, index=0, size=0xbfffdca8, suppressErrors=true) at engines/tsage/resources.cpp:403 #5 0x08087a5c in TsAGE::ResourceManager::getSubResource (this=0xb6bd5130, resNum=9, rlbNum=6, index=0, size=0xbfffdca8, suppressErrors=false) at engines/tsage/resources.cpp:497 #6 0x080804b6 in TsAGE::surfaceFromRes (resNum=9, rlbNum=6, subNum=0) at engines/tsage/graphics.cpp:123 #7 0x0820b9a9 in TsAGE::BlueForce::AmmoBeltDialog::draw (this=0xb5c22bb8) at engines/tsage/blue_force/blueforce_dialogs.cpp:347 #8 0x0820b3f2 in TsAGE::BlueForce::AmmoBeltDialog::execute (this=0xb5c22bb8) at engines/tsage/blue_force/blueforce_dialogs.cpp:232 #9 0x0817138b in TsAGE::BlueForce::BlueForceInvObjectList::SelectItem ( objectNumber=66) at engines/tsage/blue_force/blueforce_logic.cpp:1327 #10 0x08061dbd in TsAGE::UIInventorySlot::process (this=0xb5c01ee0, event=...) at engines/tsage/user_interface.cpp:180 #11 0x080626f0 in TsAGE::UIElements::process (this=0xb5c01614, event=...) at engines/tsage/user_interface.cpp:338 #12 0x0816f080 in TsAGE::BlueForce::SceneHandlerExt::process (this=0xb5c05b08, ---Type <return> to continue, or q <return> to quit--- event=...) at engines/tsage/blue_force/blueforce_logic.cpp:955 #13 0x0807262c in TsAGE::SceneHandler::dispatch (this=0xb5c05b08) at engines/tsage/core.cpp:4200

comment:2 by digitall, 9 years ago

Summary: BF: Crash when trying to reload gun in boatTSAGE: BF: Crash when trying to reload gun in boat

comment:3 by digitall, 9 years ago

The problem seems to be the picture resource for the empty gun clip... If you have any bullets left, then the dialog with gun and clips to change appears fine and allows you to swap clips.

comment:4 by digitall, 9 years ago

Owner: set to dreammaster

comment:5 by digitall, 9 years ago

IIRC I did bisect for this issue with no success i.e. it is not a recent regression. Since it is not necessary to fire much in the game, it is likely that this issue with the empty clip has not been noticed before now.

dreammaster: Can you take a look at this?

comment:6 by dreammaster, 9 years ago

Fixed the problem. It was a missing a '+ 1' when calculating the frame number to use based on the number of bullets remaining. So even when the clip was full, it was showing with a bullet missing, and we didn't notice it. And of course, when the clip was empty, the frame number used was an invalid '0'.

Just for reference in case of further problems, this ammo belt dialog draw routine corresponds to ovr194:0CDh in our Blue Force disassembly.

comment:7 by dreammaster, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.