Opened 5 years ago

Closed 5 years ago

Last modified 6 months ago

#6677 closed defect (fixed)

BinkDecoder::loadStream is using too much stack.

Reported by: anotherguest Owned by: wjp
Priority: normal Component: Port: Symbian
Keywords: Cc:
Game: Backyard Football

Description

  • ScummVM version 1.7.0git
  • Version of game: Backyard Football 2002
  • Platform Symbian OS, GCC 3.4.3 & 4.x

Description:
When testing Backyard Football 2002 on Symbian OS we saw that it did not start properly. Debugging the code showed that the BinkDecoder::LoadStream is using > 270kb of stack. (Symbian OS has a limit of 89kb when using default max settings).

The reason is that the AudioInfo struct is using 0x42000(270336) bytes of data.

This is the code in BinkDecoder::loadStream allocating the AudioInfo struct on the stack.

    // Reading audio track properties
    for (uint32 i = 0; i < audioTrackCount; i++) {
        AudioInfo track;

Suggestion:
Allocate the AudioInfo struct on the heap instead of the stack.

Ticket imported from: bugs/6677.

Change History (6)

comment:1 Changed 5 years ago by wjp

Summary: BinkDecoder::loadStream is using to much stack.BinkDecoder::loadStream is using too much stack.

comment:2 Changed 5 years ago by wjp

I've committed a22f9bccf3624a0f9a085391edddeef47eaa8c5f to master as a fix. Could you test if this fixes the problem on Symbian OS? We can copy it to branch-1-7 then.

comment:3 Changed 5 years ago by anotherguest

Tested on Symbian OS, and this fixes the problem on Symbian OS! So go ahead and merge the fix to the branch-1-7. :)

comment:4 Changed 5 years ago by wjp

Owner: set to wjp
Resolution: fixed
Status: newclosed

comment:5 Changed 5 years ago by wjp

Thanks for the quick test! Committed, and closing.

comment:6 Changed 6 months ago by digitall

Component: Port: Symbian
Game: Backyard Football
Note: See TracTickets for help on using tickets.