Bug #3942

Corrupt encoding of container version 2 GRF

Added by oberhuemer over 4 years ago. Updated about 4 years ago.

Status:ClosedStart date:2012-04-26
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


Related to #3912. One revision later, in which the only change was to pass GRFCodec the "-g 2" argument for inclusion of 32 bpp sprites, the sprites in the GRF have become completely mangled (see the screenshot). Decoding the attached GRF, compiled with r930, gives me this output and produces two zero-byte PNG files.

grfcodec -d britrains.grf -h 5000 -p 1
Found grf container version 2
Sprite 0 at F, 0% done
Error: not enough data to perform regular decoding for sprite 379

britrains.grf (5.9 MB) oberhuemer, 2012-04-26 04:19

Unnamed, 18th Jan 20000.png (85 KB) oberhuemer, 2012-04-26 04:19

Unnamed, 7th Jan 20000.png (129 KB) oberhuemer, 2012-04-26 04:28

britrains.grf (7.64 MB) oberhuemer, 2012-04-26 04:28

Associated revisions

Revision 934:705e415b886b
Added by frosch about 4 years ago

Fix #3942: Decoding of regular encoded 32bpp sprites failed.


#1 Updated by oberhuemer over 4 years ago

NML does the better job yet again.

#2 Updated by oberhuemer over 4 years ago

GRFCodec shows the same decoding errors and produces the same empty PNGs even with the latter NewGRF.

#3 Updated by oberhuemer about 4 years ago

The same error appears when decoding OpenGFX+ Trains r448, with only the sprite number changed to 346. I hope this doesn't mean GRFCodec's support for decoding (and encoding) container version 2 is completely broken.

#4 Updated by frosch about 4 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset 705e415b886b.

Also available in: Atom PDF