After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 147759 - Saving RLE-compressed BMP on big-endian host corrupts file
Saving RLE-compressed BMP on big-endian host corrupts file
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
git master
Other All
: Normal critical
: 2.0
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2004-07-17 08:48 UTC by Brion Vibber
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix patch (524 bytes, patch)
2004-07-17 09:34 UTC, Brion Vibber
none Details | Review

Description Brion Vibber 2004-07-17 08:48:07 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.
Comment 1 Brion Vibber 2004-07-17 09:34:40 UTC
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.
Comment 2 Philip L 2004-07-17 11:39:46 UTC
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.
Comment 3 Sven Neumann 2004-07-17 15:22:57 UTC
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.