Bug #7063
Crashes by decoding
Status: | Closed | Start date: | 2014-08-31 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 100% | |
Category: | grfcodec | |||
Target version: | - |
Description
I was trying to decompile following file:
http://binaries.openttd.org/bananas/newgrf/Pineapple_Trains-1.11.tar.gz
with command:
grfcodec.exe -d pb_trains_10CC.grf
Grfcodec version is 'trunk-r983'.
Following error occurred:
Found grf container version 2
Decoding:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Associated revisions
Fix #7063: don't make infinite length sprite sheets as they can become too large to be buffered and cause a crash during decoding
History
#1 Updated by Rubidium over 6 years ago
The looks like a memory allocation issue where not enough contiguous space could be found to allocate memory for a larger buffer for PNG sprites. At peak the program uses about 1 GB for me, for a significant share caused by the huge sprite sheets (about 200 000 lines).
Use -h to limit the maximum size of the sprite sheets.
#2 Updated by Muzzy over 6 years ago
Thanks for explanation.
It would be nice to have a warning message telling that memory is not enough.
#3 Updated by Rubidium over 6 years ago
- % Done changed from 0 to 100
- Status changed from New to Closed
Applied in changeset a829c0cec2f3.