* #797 possible leak on png error, returns from setjmp lost the row_pointers ref somehow
* skip that one using mingw until we have a reliable portable FP related tests suites (may never happpen)
When reading images in GD or GD2 format, we have to ensure that the
transparent color is not set, if it would refer to a non-extant palette
entry.
We back that up with respective regression tests.
Besides the original fix, which catered to the subsequent output, the
potential DOS vulnerability due to a corrupted GD2 image file has been
fixed with c6bb583, and here we make sure that this very image is also
handled properly.
GD2 stores the number of horizontal and vertical chunks as words (i.e. 2
byte unsigned). These values are multiplied and assigned to an int when
reading the image, what can cause integer overflows. We have to avoid
that, and also make sure that either chunk count is actually greater
than zero. If illegal chunk counts are detected, we bail out from
reading the image.
This makes it a bit cleaner when dealing with optional tests as we
use the LIST(APPEND...) command everywhere instead of sometimes SET
and sometimes LIST.
Since we have random files we want to read & check, turn the two
read programs into general tools. Then we have shell scripts to
run against the right inputs.
Most of the changes here are just shuffling variable names so we
can add to check_PROGRAMS independently of TESTS.
This makes the test code a lot easier to manage rather than copying &
pasting the same boiler plate multiple times.
Also take the opportunity to add a common prefix to each test name so
we don't get collisions between subdirs if a test happens to use the
same exact name.
- jpeg and freetpye (2.3.5) compiled under mingw seems to behaves differently.
jpeg_read and freetype/bug00132 tests fail. I will have to investigate later