Part 1: If given a text file which has the first two characters as "BM", Fl_BMP_Image will attempt to load that file as a valid bitmap file. Depending on what is in the text file, Fl_BMP_Image will crash in various ways.
The fix is to verify the existence of some required attributes of a valid Bitmap header and set the file's fail() state.
Part 2: Having fixed the above bug, I then discovered that Fl_Shared_Image did not check the fail() state, and proceeded to act as if the invalid Fl_BMP_Image was in fact valid.
The fix here is to check the fail() state: in a failure situation, delete the invalid object, and continue iterating through the image handlers.
You can view, comment on, or merge this pull request online at:
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.