GNOME Bugzilla – Bug 171646
Bmp plugin incorrectly reports "invalid compression" when bitdepth is invalid
Last modified: 2008-01-15 12:50:54 UTC
Please describe the problem: When you try to load a (corrupt) bmp with an invalid bitdepth (but a valid compression field), the bmp plugin incorrectly reports that the bitmap's compression is invalid. The bug is in ReadImage() in plug-ins/bmp/bmpread.c. The erroroneous text is in the default case of the first switch(bpp) statement. It's on line 477 in gimp-2.2.4. This looks like a simple copy & paste error. Steps to reproduce: 1. Try to load bitdepth-zero.bmp (it has a bitdepth of 0) Actual results: The GIMP reports that it can't load the image because "Unrecognized or invalid BMP compression format." Expected results: The GIMP reports that it can't load the image because "Unsupported or invalid bitdepth." Does this happen every time? Yes Other information:
Created attachment 39259 [details] bitdepth-zero.bmp -- a bitmap with claimed bitdepth of 0 The bitmap is otherwise a valid 1bpp bitmap.
Created attachment 39260 [details] [review] Proposed fix
That would be a string change. We can only do that in the HEAD branch. It's not worth breaking the string freeze for such a trivial (almost artificial) problem.
2005-03-25 Sven Neumann <sven@gimp.org> * plug-ins/bmp/bmpread.c: better error message (bug #171646).