| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ensure that a GIF without any Global or Local color tables is still
decoded by libgd.
GIF89a spec indicates conforming image files need not have
Global or Local color tables at all.
Spec recommends creating custom color map in that situation, and
that at least Black+White as first two entries, to ensure B&W images
are decoded.
Some commonly used single-pixel GIFs found around the web are
undecoded by libgd otherwise. Test case has been included.
References:
https://www.w3.org/Graphics/GIF/spec-gif89a.txt
http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Whenever `gdImageGifAnimAddPtr()` calls `gdImageGifAnimAddCtx()` and
the latter fails, we must not call `gdDPExtractData()`; otherwise a
double-free would occur. Since `gdImageGifAnimAddCtx` is a void
function, and we can't change that for BC reasons, we're introducing
a static helper which is used internally.
|
|
|
|
|
| |
This is preparation for adding some linting checks for new commits from
people. Shouldn't be any functional changes here (tests still pass!).
|
|
|
|
|
|
|
|
|
| |
These tests aren't broken because they didn't free the buffers, but
by cleaning these up, it's safe to run the testsuite through the leak
sanitizer (LSAN) to detect real leaks in the rest of the library.
See the previous commit 98b3f04b21b408573a72548858096770dd12b027 as
an example of LSAN being useful.
|
|
|
|
|
|
|
|
|
|
|
| |
Due to a signedness confusion in `GetCode_` a corrupt GIF file can
trigger an infinite loop. Furthermore we make sure that a GIF without
any palette entries is treated as invalid *after* open palette entries
have been removed.
CVE-2018-5711
See also https://bugs.php.net/bug.php?id=75571.
|
|
|
|
|
|
|
| |
oss-fuzz pointed out:
gd_gif_in.c:605:16: runtime error: index 5595 out of bounds for type 'int [4096]'
Add some bounds checking on each code that we read from the file.
|
| |
|
|
|
|
|
|
|
|
| |
The stack allocated color map buffers were not zeroed before usage, and
so undefined palette indexes could cause information leakage.
This issue has been reported by Matviy Kotoniy to security@libgd.org in
<CAKm_7a-AO++B6cXYWM_DtycPENG5WNWK7NSEvQ5OmZziMY_JyA@mail.gmail.com>.
|
| |
|
|
|
|
|
|
| |
gdImageGif() converts to palette using GD_QUANT_DEFAULT which is
configuration dependend. To circumvent this we're converting to palette
ourselves, explicitly setting the desired quantization method.
|
|
|
|
| |
gdTestErrorMsg
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
A lot of tests want to read images/fonts that exist in tests/ for reading.
Rather than construct these paths by hand in every single test file, add a
few helper functions to quickly access them.
The helper functions are slightly slower (due to the repeated calls to the
strcat func), but they aren't terribly slow, especially relative to image
loading that these tests perform. They also make writing/maintaining the
tests a lot easier which is more important here.
|
|
|
|
|
|
|
|
|
| |
Many of the tests open files in local paths for writing which leaves a
variety of temp files in the tests subdirs. This ends up failing in a
few scenarios like out of tree builds or cmake builds.
Add a few helper functions to the common gdtest module to quickly get
handles to temp files for the tests to leverage.
|
|
|
|
|
|
|
|
|
| |
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 matches what we've done with cmake files, and it makes managing
the subdirs much easier.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This makes it easier to keep track of things. The single toplevel list
can make it hard to notice when something is stale.
|
|
|
|
| |
compatibility.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
at least for gcc's cpp: http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* gdImageCreateFrom*() returns null if null pointer given
* gdImage*() puts nothing if null pointer given
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
- 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
|
|
|