Opened 10 years ago

Closed 10 years ago

Last modified 5 years ago

#6677 closed defect (fixed)

BinkDecoder::loadStream is using too much stack.

Reported by: anotherguest Owned by: wjp
Priority: normal Component: Port: Symbian
Version: 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 by wjp, 10 years ago

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

comment:2 by wjp, 10 years ago

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 by anotherguest, 10 years ago

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 by wjp, 10 years ago

Owner: set to wjp
Resolution: fixed
Status: newclosed

comment:5 by wjp, 10 years ago

Thanks for the quick test! Committed, and closing.

comment:6 by digitall, 5 years ago

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