On Fri, Dec 22, 2000 at 12:26:54PM -0600, Federico Mena Quintero wrote:
> "Adam D. Moss" <[EMAIL PROTECTED]> writes:
>
> > Right, this is a bad-data problem, and "WON'T FIX". The
> > source XCF image contains pixels with an index of 34 (the
> > screen on the computer icon) but only declares a palette
> > of 20 colours. Why? You tell me! Had the original image
> > been anywhere near a really old version of GIMP? There was
> > a palette bug from GIMP 0.53.0 -> 0.99.low-x which could
> > cause such a problem.
>
> The GIMP should not crash on a corrupt image file. Ever.
>
> The GIMP should not crash, ever. Period.
Gimp is in userspace and running on hardware, so the latter is a bit
harsh IMHO. Let's say rather "Gimp should not cause itself to crash"
Hmmm. Use a fixed 256 RGB triples in the palette, then change existing
code to only overwrite it, never re-allocate. Out-of-bounds index
values will not have a defined color, but they won't crash. The "size"
of the palette can still be an internal variable, it just won't reflect
the _literal_ size of the palette array.
This is safe and easy. More "thorough" fixes can be left for another
version of Gimp I think.
Nick.