| 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the adoption of AVIF by Firefox and Chromium based browsers (still
in experimental phase), the newer incorporation of HEIF by Canon and Sony
in their cameras and the newer support of both of them in modern software
like ImageMagick, GIMP and Krita, `gd` haven't seen any endorsement for
the formats up until this PR.
Reading and writing is done by `libheif`, with functionality for chroma
subsampling (for now `4:2:0`, `4:2:2` and `4:4:4`), quality (with new
`200` for lossless) and compression (whether `HEVC` or `AV1`) selection.
This was tested with `libheif` version `1.11.0` in my Solus machine.
Also, fixes both #395 and #557.
|
|
|
|
| |
Should hopefully not break anything :).
|
|
|
| |
gdImageCreate returns NULL in gdimageline_bug5.c on AIX, which make the judgement necessary in case of segment fault.
|
|
|
|
|
|
| |
We change the return type of `textLayout()` to `ssize_t`, and signal
failure by returning `-1`, so that laying out an empty string is no
longer handled as failure. We make sure that no overflow occurs,
assuming that all `int` values can be fully represented as `ssize_t`.
|
|
|
|
| |
Fixed #623. wchar_t is 32 bits on 64-bits AIX, which will result in test case failure.
So we replace wchar_t with unsigned short array.
|
| |
|
|
|
| |
@pierrejoye has implemented opendir, closedir and readdir in readdir.c, which is only used under windows platform. These functions are enabled by modifiying the tests/gdTest/CMakeLists.txt
|
|
|
|
| |
tests/webp/bug_double_free should depend on webp and jpeg.
tests/gdimagesquaretocircle should depend on png.
|
|
|
| |
And add test case for it.
|
|
|
|
| |
Fix the memory leakage in following test cases: tests/bug_overflow_lagre_new_size.c, tests/gdimagecrop/bug00486.c, tests/bmp/bug00450.c
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
According to the result, the extra one pixel is unnessary. Deleting the related code block makes
the image looks fine.
|
|
|
| |
Update var type to hold bigger w&h for ellipse. And add corresponding test cases.
|
| |
|
|
|
|
| |
We have to properly distinguish between truecolor and palette images.
|
|
|
|
| |
We have to properly initialize `interpolation_id_bak`.
|
| |
|
|
|
|
| |
We have to avoid the unintended fall through.
|
|
|
|
|
| |
We have to check the return value of `gdAffineInvert()`, and on failure
let `gdTransformAffineCopy()` fail as well.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Fixed CVE-2019-6977 and add corresponding testcase.
Original patch by Christoph M. Bechker <cmbecker69@gmx.de>
https://gist.github.com/cmb69/1f36d285eb297ed326f5c821d7aafced
|
| |
|
|
|
|
| |
add testcase for gdImageColorClosestHWB
|
|
|
|
| |
add testcase for gdImageColorMatch
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
* config.h is never generated in msys with existing windows/msys/Makefile
* errno.h is to solve EEXIST is not defined error
* GDTEST_TOP_DIR is defined in other compile ways except msys and test_config.h is created by windows/msys/run_test.sh
* Ui64 is only created by microsoft by not support in windows and ULL is common used and general supported
* _int64 is only support by vc but __int64 can be support in win
|
|
|
|
| |
* CMakeLists.txt: Exclude libm dependency under win
* CMakeLists.txt: Move win32/m logic into cmake/modules/gd.cmake
|
| |
|
|
|
|
|
| |
When using gdImageCreateFromXbm() it is possible to supply data that
will cause the function to use the value of uninitialized variable.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Consistent use of LIST(APPEND over SET(
|
|
|
|
| |
again. #382
|
|
|
|
|
|
| |
We do this for some funcs already, so add jpeg/png/tiff/liq/webp
stubs too. This keeps our ABI stable and lets code do runtime
detection instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Whenever `gdImage*Ptr()` calls `gdImage*Ctx()` and the latter fails, we
must not call `gdDPExtractData()`; otherwise a double-free would
happen. Since `gdImage*Ctx()` are void functions, and we can't change
that for BC reasons, we're introducing static helpers which are used
internally.
We're adding a regression test for `gdImageJpegPtr()`, but not for
`gdImageGifPtr()` and `gdImageWbmpPtr()` since we don't know how to
trigger failure of the respective `gdImage*Ctx()` calls.
This potential security issue has been reported by Solmaz Salimi (aka.
Rooney).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The fix for PHP bug 43828[1] changed the algorithm from drawing filled
pies from drawing multiple triangles to drawing a single polygon. Due
to quirks of the filled polygon drawing algorithm, we had to filter out
extraneous vertices. This lead, however, to a bug regarding displaced
starting and ending points near 90° and 270° degrees, which we fix by
reinserting these vertices if they had been removed.
[1] <https://bugs.php.net/bug.php?id=43828>
|
|
|
|
|
| |
For 1 bit per pixel bitmap images, when the width of the image match
some specific values (for instance, 10px), the image loading fails.
|
|
|
|
|
| |
`gdGuessBackgroundColorFromCorners()` is supposed to handle *all* cases
where an image has exactly two equal colors in the same way.
|