mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00

The palette index checking function is called by default but only if some *other* transformation is happening. This makes the 'get palette max' public API disfunctional (sometimes it works, sometimes it returns 0) and causes the supposed default behaviour of checking the palette index only to work sometimes. It works in pngtest, it doesn't work in pngcp. The check in pngread also has an off-by-one error; the number recorded is the highest index found so it should be checked to ensure that it is less than the palette length but it was checked for being greater. The pull request includes a set of 8 files which all have the full range of possible indices including one (the highest) which is invalid because the PLTE chunk is one short of the maximum for each bit depth. Signed-off-by: John Bowler <jbowler@acm.org>
This "contrib" directory contains contributions which are not necessarily under the libpng license, although all are open source. They are not part of libpng proper and are not used for building the library, although some are used for testing the library via "make check".