Commit Graph

27 Commits (master)

Author SHA1 Message Date
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 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 9cb2d1dcf5 Fix #725, Gif Anim API, adding frame leak from tmp image, test already in place (gcc ASAN detects it) 2021-08-13 21:53:37 +07:00
Christoph M. Becker 48ffba3f1b Fix GD build with -D SIGNED_COMPARE_SLOW
Apparently, this has not been tested for a long time, and might be a
refactoring relict.  Anyhow, we have to pass the context to
`GIFNextPixel` as well.

This issue has been reported by Kleber Tarcísio.
2019-11-21 20:07:20 -05:00
Christoph M. Becker 55f3b360c0 Fix #499: gdImageGifAnimAddPtr: heap corruption with 2 identical images
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.
2019-05-26 11:01:14 +02:00
Christoph M. Becker 553702980a Fix #492: Potential double-free in gdImage*Ptr()
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).
2019-01-17 11:54:55 +01:00
Mike Frysinger fd06f7f83c clean up trailing whitespace/newlines
This is preparation for adding some linting checks for new commits from
people.  Shouldn't be any functional changes here (tests still pass!).
2018-06-21 22:47:42 -04:00
Christoph M. Becker c1804def24 Mark up code examples with (start|end code)
This makes the code better readable in the sources, and we get syntax
highlighting in the generated HTML wherever we want it (i.e. not necessarily
always as with `-hl all`).
2016-08-23 22:27:27 +02:00
Christoph M. Becker 9a3bd7077e Group the supported image formats in the menu of the docs
To do so we have to add Menu.txt to the project, but we can ignore
Languages.txt and Topics.txt, at least for now.
2016-08-14 16:11:05 +02:00
Mike Frysinger 82b80dcb70 gif: avoid out-of-bound reads of masks array #209
When given invalid inputs, we might be fed the EOF marker before it is
actually the EOF.  The gif logic assumes once it sees the EOF marker,
there won't be any more data, so it leaves the cur_bits index possibly
negative.  So when we get more data, we underflow the masks array.

Flag it so we don't try to output anything more.  The image is invalid,
so we shouldn't be truncating any valid inputs.

This fixes #209.
2016-05-14 02:13:15 -04:00
Chris Reuter 275ac17bcc Started importing the old manual into Naturaldocs comments.
This changeset imports documention for gdImage to gdImagePng*() into
Natural Docs.  Documention is based on the text of the original
manual, version 2.0.36 but adapted to better suit the format.
Subsequent changesets will introduce docs for subsequent manual
entries.

naturaldocs, when present, is invoked by bootstrap.sh.  The completed
manual will be in docs/naturaldocs/html/index.html.  It can also be
explicitly invoked by running docs/naturaldocs/run_docs.sh.

This change also removed docs/naturaldocs/project/Menu.txt, since it
currently contains no non-generated content and is prone to introduce
noise into the changeset.
2014-01-07 15:29:06 -05:00
Ondřej Surý f52b1dd55d Fix config.h include before gd.h to get the HAVE_VISILIBITY symbol available 2013-04-12 15:01:43 +02:00
Ondřej Surý 15ea6bc5a1 Fix several uninitialized variable reads, dereferences before NULL checks, resource leaks and some other minor errors 2013-04-08 12:53:52 +02:00
pierrejoye e20413bf6b - apply same CS everywhere 2013-04-03 14:23:11 +02:00
tabe db10f301ff fixed FS#227 2010-08-24 18:33:02 +09:00
tabe 89a6f2f711 removed an unused variable 2010-01-13 15:55:39 +09:00
tabe 53d6320309 fixed possible segfaults when gdNewDynamicCtx() returns null 2009-06-25 19:05:45 +00:00
tabe e27c3c7f2c fix for FS#204
* gdImageCreateFrom*() returns null if null pointer given
* gdImage*() puts nothing if null pointer given
2009-06-18 13:35:26 +00:00
tabe 9225b25e8e fixed #181. 2008-11-03 13:24:36 +00:00
mattias 4b3804e683 - According to the standard, the '#' char must be at column 0 (Thanks Nuno) 2007-10-28 23:09:09 +00:00
mattias ff5ae39b04 - ws + cs 2007-10-24 20:15:22 +00:00
pajoye ac4d0ef94f - #14, sanity check in gd_gif_out 2007-01-04 12:44:31 +00:00
pajoye 9575411e8d - #4, TrueColor transparency with GIF palette output 2006-10-08 16:42:47 +00:00
pierre 445e5e97a4 - sync to 2.0.33 2006-04-05 15:55:57 +00:00
pierre 5742a4107e - sync to 2.0.29 2006-04-05 15:54:20 +00:00
pierre b9d845987e - sync to 2.0.28 2006-04-05 15:53:57 +00:00
pierre 0b6804ee48 - sync to 1.5.0 2006-04-05 15:35:09 +00:00