Commit Graph

1237 Commits (master)

Author SHA1 Message Date
Khem Raj 7dae724967 Fix deprecared function prototypes
Fixes following errors:
error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-08-23 08:59:29 -07:00
Christoph M. Becker dbe3001a12
Merge pull request #833 from khaledhosny/fix-raqm-rotation
Fix #790, don't rotate glyph positions with Raqm 0.9.0+
2022-08-08 14:33:11 +02:00
Christoph M. Becker 0050cc8182
Fix #834: gdfonts.c comment mistake 2022-08-05 15:07:22 +02:00
Khaled Hosny 52b4da0967 Fix #790, don't rotate glyph positions with Raqm 0.9.0+
Raqm will apply the transformation matrix set on the FT_Face itself.
2022-08-01 20:55:37 +02:00
Christoph M. Becker 4b5b2f122b
Fix #831: gdImageAvif memory leak
First, we must not forget to call `avifImageDestroy()` when we're
finished with the image.

Then we also need to cater to the allocated `dataBuf`.  To keep track
of that, we "extend" `avifIO` as `avifIOCtxReader`.  To simplify, and
to avoid unnecessary allocations, we use `realloc()`.  To better fit
with GD, we also use the GD memory allocation functions instead of the
ones provided by libavif.
2022-06-10 13:58:56 +02:00
مهدي شينون (Mehdi Chinoune) 7efcf4f935
Some fixes for MINGW (#828)
* Enable webpng on MINGW

* Detect GD version using cmake language

* Use _aligned_malloc instead of posix_memalign on Windows

* Include missing "errno.h"

* Fix finding WEBP on MINGW

* Fix finding XPM on MINGW

* Use PkgConfig to find packages on MINGW

* CI: Enable more options  for MINGW
2022-04-15 15:34:24 +07:00
Brett 5c8d8d1159
enable interlace transform when reading png (#823) 2022-02-07 12:57:24 +07:00
Pierre Joye 167ea1f4f0
Fix tests based on coverity reports (#819)
* Partial #818, unused arg

* Partial #818, init var

* partail #818, fix va_args usage

* partail #818, handle f* calls and avoid possible call to malloc with negative values

* partail #818, prevent double free

* partail #818, resource leak if test fail

* partail #818, null deref fix

* partail #818, avoid double free on fp failure

* Partial #818, fix error msg

* Partial #818, leak on error

* Partial #818, null deref

* Partial #818, avoid possible negative index on failure

* partial #818, does not free if we return if requested new size overflow

* partial #818, avoid double free, free where the alloc happened
2022-02-01 15:09:01 +07:00
Pierre Joye 3f08a018cb
Fix #815, gd_topal, explicit null dereferenced (kind of false positiv… (#816)
* Fix #815, gd_topal, explicit null dereferenced (kind of false positive however it does hurt to add that check)

* Fix #815, != NULL
2022-01-31 11:46:15 +07:00
Pierre Joye ebf0fb1996
Fix #812, ensure operands priorty works as expected (#813) 2022-01-30 11:04:28 +07:00
Pierre Joye d1e2522474 Fix #808, free info. Not sure what happens, it keeps being removed on cherry-pick to 2.3.... 2022-01-30 11:00:39 +07:00
Pierre Joye cfe84e9b3b Fix #808, free info. Not sure what happens, it keeps being removed on cherry-pick to 2.3.... 2022-01-30 10:59:22 +07:00
Pierre Joye 0d50039b14 Fix #808, improve fix here, at this stage info is not null (deref earlier too) 2022-01-30 10:40:36 +07:00
Pierre Joye 767699b9f4 Fix #808, When RAQM is used, and it fails or no text processed, the glyph may be leaked 2022-01-30 09:33:07 +07:00
Pierre Joye 6cc1e39e9f
Fix #810, Wrong image freed, src_cloned should be freed if set. (#811) 2022-01-29 23:18:28 +07:00
Pierre Joye 1186f918eb
Fix #806, getPixelInterpolateWeight, getPixelOverflowTC, getPixelOver… (#807)
* Fix #806, getPixelInterpolateWeight, getPixelOverflowTC, getPixelOverflowPalette, gdImageRotate* take bgcolor as GD's truecolor, result is a TC image as well.Clean dead code.

* Not needed at this stage
2022-01-29 21:03:47 +07:00
Pierre Joye 6bbeba447b
Fix #808, When RAQM is used, and it fails or no text processed, the glyph may be leaked (#809) 2022-01-29 21:03:29 +07:00
Pierre Joye 0956816bc6
#797 possible leak on png error, returns from setjmp lost the row_poi… (#802)
* #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)
2022-01-23 11:57:49 +07:00
Pierre Joye 3f872fc931
#792, document gdImageEllipse (#803) 2022-01-23 11:56:41 +07:00
Pierre Joye f1a53c0821
#788 fix bug in HEIF usage, stride is require (#801)
fix bug #788 in HEIF usage, stride is require
2022-01-22 17:29:04 +07:00
woho 636100b928 Catch libpng warnings (#295) 2021-10-21 12:02:29 -04:00
Robert Hart ba14dec6ef
Fix out of bounds write im->alpha[im->transparent] (#785)
Since #737 gdImageColorTransparent does not correctly handle the case that im->transparent = -1
(which is the initial value and used to indicate no transparent colour has been set).

This leads to undefined behaviour via an out-of-bound write:
im->alpha[im->transparent] = gdAlphaOpaque;
(in practice I assume this merely overwrites an earlier struct member)

This can be triggered via loading a gif through gdImageCreateFromGifPtr

third_party/gd/source/gd.c:922:2: runtime error: index -1 out of bounds for type 'int [256]'
    #0 0x5629c034a839 in gdImageColorTransparent third_party/gd/source/gd.c:922:29
    #1 0x5629c034ebf0 in gdImageCreateFromGifCtx third_party/gd/source/gd_gif_in.c:328:4
    #2 0x5629c034f14f in gdImageCreateFromGifPtr third_party/gd/source/gd_gif_in.c:186:7

Fixes #784.
2021-10-09 11:40:45 -04:00
Tim Gates f7e57be725 docs: Fix a few typos
There are small typos in:
- examples/copyrotated.c
- src/gd.c
- src/gd.h
- src/gd_avif.c
- src/gd_nnquant.c
- src/gd_tga.c
- src/gd_topal.c
- src/wbmp.c
- tests/avif/compare_avif_to_png.c

Fixes:
- Should read `requires` rather than `reqiures`.
- Should read `of the` rather than `ofthe`.
- Should read `memory` rather than `memmory`.
- Should read `maximum` rather than `maxmum`.
- Should read `intersection` rather than `intertersection`.
- Should read `hypotenuse` rather than `hypothenus`.
- Should read `flexibility` rather than `flexibilty`.
- Should read `always` rather than `alwasy`.
- Should read `also` rather than `alos`.
2021-09-23 01:13:40 -04:00
Pierre Joye 6f5136821b
Merge pull request #755 from libgd/bug/750
Partial fix for #750, BMP and WebP. Gif's usage of PutBuf needs too much refactoring for the actual gain here."
2021-09-08 10:08:12 +07:00
Pierre Joye 75fecefe77 <3 the CI, forgot header for gd_error and unused var, strict mode for the win :) 2021-09-07 22:10:26 +07:00
Pierre Joye e5c84f0b7a Partial fix for #750 2021-09-07 22:03:21 +07:00
Arun 16ebd800f7 Fixed typo 2021-09-06 08:29:50 -04:00
Pierre Joye 4a0d7d86f0 Fix #320, should not convert the source to palette 2021-09-01 14:05:56 +07:00
Pierre Joye 6402cdf87e
Merge pull request #747 from libgd/features/mingw-ci
Rewrite CI to use Github Actions and improve builds. Platform:
- Ubuntu 20.04, gcc, x64 and ARM64 (graviton2)
- Ubuntu 20.04, clang, x64 and ARM64 (graviton2)
- Windows, x64, x86, arm64 VC
- Windows, mingw, x64, x86, ucrt64
- MacOS, x64 xcode

See docs/README_CI.md for additional details.
2021-09-01 10:21:20 +07:00
Pierre Joye 9251cd60d0
Merge pull request #736 from libgd/bug/415
Fix #415, Assuming TopOfs and LeftOfs zero, we can safely skip any (x…
2021-08-31 18:48:20 +07:00
Pierre Joye c6fcb5d4cb These are not .c files, should work on gcc and make clang linker happy 2021-08-29 23:42:39 +07:00
Pierre Joye 65914f9e90 #ifdef 2021-08-29 22:54:34 +07:00
Pierre Joye 98451864ce fix build for arm64, also use generic intrin.h instead of the x86 series specific 2021-08-29 05:55:52 +07:00
Pierre Joye 1b3f6fbe94 Fix #410, document the exact behavior. It is not possible to change behavior at this point. 2021-08-27 07:00:11 +07:00
Pierre Joye b214ab236a
Merge pull request #737 from libgd/bug/405
Fix #405, -1 aims to reset the transparent color; refactor a bit; add test to existing test for -1
2021-08-27 01:24:00 +07:00
Pierre Joye 0bc3170fa7
Merge pull request #741 from mvorisek/patch-1
Fix gdAlphaMax limit typo
2021-08-27 01:23:26 +07:00
Michael Voříšek e8642aa54e
Fix gdAlphaMax limit typo 2021-08-26 18:59:12 +02:00
Pierre Joye 13d3b67822 Fix #402, negative determinant fails, only 0 or not finite should fail 2021-08-26 22:40:15 +07:00
Pierre Joye 63070b49e2 Merge branch 'master' of github.com:libgd/libgd 2021-08-26 21:48:43 +07:00
Pierre Joye 4dcc6025cb document gd Matrix 2021-08-26 21:48:17 +07:00
Pierre Joye de563c2520
Merge pull request #636 from willson-chen/mv_gd_color_map_test_to_tests
Move src/gd_color_map_test.c to tests
2021-08-26 19:11:15 +07:00
Pierre Joye 3a4d2127ef -1 resets the transparent color, return here. 2021-08-25 21:48:19 +07:00
Pierre Joye 67cc752b40 Fix #405, -1 aims to reset the transparent color; refactor a bit; add test to existing test for -1 2021-08-25 18:44:02 +07:00
Pierre Joye 4cd5542152 fix #415, the same is needed in the other section, add test 2021-08-25 17:48:03 +07:00
Pierre Joye bdc281eadb Fix #318, these macros are not used as planed, we have separate functions for each 2021-08-25 15:28:32 +07:00
Pierre Joye 5771e976bd Fix #415, Assuming TopOfs and LeftOfs zero, we can safely skip any (x,y) out of the previous image bounds 2021-08-25 12:52:45 +07:00
Pierre Joye 49ecef1bf4 avoid case w/255.5+0.5 (kudos @cmb69) 2021-08-25 00:09:05 +07:00
Pierre Joye 8890f527b2 #661, restore correct clamping, fixing alpha artifacts (these ones are the most visible) 2021-08-24 23:08:09 +07:00
Pierre Joye c5fd25ce0e
Merge pull request #713 from me22bee/_gdImageGd2
gdImageGd2Ptr memory leak
2021-08-24 16:34:59 +07:00
Maryam Ebrahimzadeh a1d4caace6
remove non-printable bytes 2021-08-24 12:02:23 +04:30