GNOME Bugzilla – Bug 147759
Saving RLE-compressed BMP on big-endian host corrupts file
Last modified: 2004-12-22 21:47:04 UTC
The BMP plug-in produces corrupt output files when saving with RLE compression on a big-endian host such as PowerPC. The corrupt files either render poorly or crash the victim apps trying to load them. Originally reported here: http://sourceforge.net/tracker/index.php?func=detail&aid=970625&group_id=104774&atid=639246 Confirmed with 2.0.1 and 2.1.2 on Mac OS X.
Created attachment 29605 [details] [review] Fix patch Changes a variable from gint to guchar. If I understand the code right its value should never be over 255, and it's sole purpose is to be written out as a one-byte value. As a gint, the wrong byte was written on big-endian hosts. Tested successfully with a couple random images, seems ok.
Nicely spotted. Applied to main and gimp-2-0 branches: 2004-07-17 Philip Lafleur <plafleur@cvs.gnome.org> * plug-ins/bmp/bmpwrite.c (WriteImage): Applied a patch from Brion Vibber that fixes corruption when saving RLE-encoded BMPs on big endian hosts. Fixes bug #147759.
BTW, GIMP bugs that are reported against the gimp.app bug-tracker and are not specific to the application bundle should be immidiately reported upstream (in other words: here). Perhaps someone could make the gimp.app maintainer aware of this.