GNOME Bugzilla – Bug 150648
Be pickier about invalid BMP files?
Last modified: 2014-10-22 16:16:29 UTC
Currently, gdk-pixbuf is very forgiving about invalid compressed data ... modulo the infinite loop described in bug 150601, what it does is simply ignore out-of-bounds data. Should we be refusing to load the file and returning an error instead? (If there are lots of BMPs out there which have out-of-bounds data, then the ignore approach is likely better) We also end up accepting arbitrary junk after the end of the BMP.
> to load the file and returning an error instead? No. Within reason importers should be forgiving of bad file formats. The user would perceive this as Gnome being broken, even if it is not really Gnome's fault. So long as it doesn't cause any severe performance reduction for the base case it seems reasonable to tolerate bad input as best as possible.
If such BMPs actually *exist* then I agree with you completely. But silently accepting invalid files before they come up makes it more likely that people will create code generating invalid bmps. And it isn't clear exactly what the interpretation should be. Is what we are going to display something the user can make sense of? So, I don't think it's completely obvious. Though you may be right.
There haven't been any particular reports about BMP files that we couldn't handle (or mistakenly handled), so I'll close this as obsolete. Please reopen if you have test files which show problems.