summaryrefslogtreecommitdiff
path: root/tests/gif
Commit message (Collapse)AuthorAgeFilesLines
* fix leaks in tests and extend a bit the timeout for ASAN modePierre Joye2021-08-131-0/+1
|
* Allow GIFs missing both Global and Local Colormaps to still decode (#494)az66672021-03-035-0/+29
| | | | | | | | | | | | | | | | | | 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
* tests/gif/bug00006.c: fix memory leakagewilson chen2020-03-171-0/+1
|
* tests: Correct some test depend errorswilson chen2020-01-022-8/+8
|
* Fix #499: gdImageGifAnimAddPtr: heap corruption with 2 identical imagesChristoph M. Becker2019-05-264-0/+54
| | | | | | | | 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.
* clean up trailing whitespace/newlinesMike Frysinger2018-06-211-1/+1
| | | | | This is preparation for adding some linting checks for new commits from people. Shouldn't be any functional changes here (tests still pass!).
* tests: clean up various buffers/objectsMike Frysinger2018-06-212-0/+3
| | | | | | | | | 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.
* Fix #420: Potential infinite loop in gdImageCreateFromGifCtxChristoph M. Becker2018-01-295-0/+32
| | | | | | | | | | | 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.
* gif: fix out-of-bounds read w/corrupted lzw dataMike Frysinger2018-01-265-1/+18
| | | | | | | 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.
* Fix typo which caused build to failChristoph M. Becker2017-08-101-1/+1
|
* Close #339: Fix unitialized memory read vulnerability in GIF readingChristoph M. Becker2017-08-105-2/+48
| | | | | | | | 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>.
* tests: sync feature enable lists in cmake files #382Mike Frysinger2017-02-151-4/+9
|
* Fix #304: test suite failure in gif/bug00006 [2.2.3]Christoph M. Becker2016-10-111-0/+4
| | | | | | 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.
* Partially implement #220: tests: replace all printf error messages with ↵Christoph M. Becker2016-07-151-5/+5
| | | | gdTestErrorMsg
* tests: cmake: switch to list appendingMike Frysinger2016-06-151-1/+1
| | | | | | 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.
* tests: add helpers for accessing test dataMike Frysinger2016-06-033-32/+7
| | | | | | | | | | | 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.
* tests: rework handling of temp output filesMike Frysinger2016-05-174-29/+28
| | | | | | | | | 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.
* tests: gd2: add general read test helpers #208Mike Frysinger2016-04-301-2/+2
| | | | | | | | | 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.
* tests: split up makefile entriesMike Frysinger2016-04-301-0/+25
| | | | | This matches what we've done with cmake files, and it makes managing the subdirs much easier.
* tests: unify cmake test code into a single macroMike Frysinger2016-04-301-6/+1
| | | | | | | | | 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.
* gitignore: split up test entriesMike Frysinger2016-04-301-0/+9
| | | | | This makes it easier to keep track of things. The single toplevel list can make it hard to notice when something is stale.
* Upgrade to long-syntax CMAKE add_test command to improve cross-platform ↵Nathanael Jones2015-01-071-2/+1
| | | | compatibility.
* Fix some unchecked values and possibly dereferenced null pointers in tests/Ondřej Surý2013-04-222-9/+51
|
* Make tests less chatty; silence them using our shiny new gdSetErrorMethodOndřej Surý2013-04-222-5/+1
|
* Merge outstanding autotools changesOndřej Surý2013-04-081-3/+0
|
* - apply same CS everywherepierrejoye2013-04-035-477/+479
|
* search GD headers locally at firstTakeshi Abe2013-03-017-11/+11
| | | | at least for gcc's cpp: http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html
* GDTESTS_TARGET_LINK is just gdTestTakeshi Abe2013-02-221-1/+1
|
* fix -Wimplicit-function-declarationtabe2013-02-152-3/+3
|
* fix -Wimplicit-inttabe2013-02-111-1/+1
|
* fix -Wunused-but-set-variabletabe2013-02-111-2/+2
|
* fix -Wunused-variabletabe2013-02-111-1/+1
|
* drop obsolete .cvsignoretabe2013-02-071-9/+0
|
* free memorytabe2010-08-241-0/+1
|
* fixed FS#227tabe2010-08-243-1/+68
|
* fixed possible segfaults when gdNewDynamicCtx() returns nulltabe2009-06-253-1/+68
|
* fix for FS#204tabe2009-06-183-1/+16
| | | | | * gdImageCreateFrom*() returns null if null pointer given * gdImage*() puts nothing if null pointer given
* get a test executable' location from its target property.tabe2009-01-071-1/+2
|
* revert to the previous revision, as EXECUTABLE_OUTPUT_PATH enabled again.tabe2009-01-061-1/+1
|
* fixed the executable paths.tabe2009-01-041-1/+1
|
* fixed #181.tabe2008-11-033-1/+67
|
* - add Makefile.am (to be packaged when used with auto*)pajoye2008-05-101-0/+3
|
* - fix tests running under MinGWpajoye2008-04-181-1/+1
| | | | | - 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
* - mv src/tests testspajoye2007-10-0215-0/+637