Commit graph

11822 commits

Author SHA1 Message Date
Heiko Lewin
ba2afdcacf cairo-quartz-image-surface.c: Add missing call to cairo_surface_reference (Thanks to Fred Bca) 2021-01-19 12:11:33 +00:00
Heiko Lewin
fa1b02d7e5 Merge branch 'fix_device_errors' into 'master'
Fix device errors

See merge request cairo/cairo!30
2021-01-19 11:26:33 +00:00
Heiko Lewin
99dc4bf4ce Fix device errors for GLESv2 contexts
Ignore GLerrors when re-selecting a (possibly deleted) GLprogram
2021-01-19 11:26:33 +00:00
Heiko Lewin
a88696ed15 Merge branch 'extend-test-pdf-tagged-text' into 'master'
Add tests for PDF metadata

See merge request cairo/cairo!100
2021-01-19 11:12:27 +00:00
Heiko Lewin
01f38097a5 cairo-xlib: Check for maximum surface size 2021-01-19 11:07:54 +00:00
Heiko Lewin
d49d855819 Merge branch 'win32-get-dc' into 'master'
cairo_win32_surface_get_dc: Return NULL for error surfaces

Closes #405

See merge request cairo/cairo!106
2021-01-19 11:06:44 +00:00
Heiko Lewin
941cddfa39 'Fix' a NULL pointer 'dereference' in cairo-pdf-surface 2021-01-19 10:48:52 +00:00
Uli Schlachter
4e2e876be1 'Fix' a NULL pointer 'dereference' in cairo-pdf-surface
The expression &image_surface->base basically just casts the
cairo_image_surface_t* to cairo_surface_t*. However, technically it is a
NULL pointer dereference and UndefinedBehaviorSanitizer flags it as
such:

runtime error: member access within null pointer of type 'cairo_image_surface_t' (aka 'struct _cairo_image_surface')

This commit fixes this by adding a NULL check.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-01-17 20:59:58 +01:00
Uli Schlachter
d72ff7c18a Merge branch 'autotools-dist-meson-subproject-wraps' into 'master'
autotools: dist meson subproject wraps

Closes #447

See merge request cairo/cairo!91
2021-01-17 10:57:48 +00:00
Uli Schlachter
0224c7802f Merge gitlab.freedesktop.org:pcpenpal/cairo 2021-01-17 08:24:00 +01:00
Uli Schlachter
4258fbd3b7 cairo 1.17.4 release
-----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEEpmEQCz2sHU8srYpU5gOyV4+48PsFAl/Cz0AaHGJyeWNlQGJy
 eWNlaGFycmluZ3Rvbi5vcmcACgkQ5gOyV4+48PtUXxAAnYipgwpcIKWoSt4eP1o/
 SPqeupY0AQUWB8y6xKoAhcBzt/HOQBqMxWo+zJSkIndJMRusezSmnt+qHY1bXGTX
 pqyipyYfSUJnT6BB/iZvwcAPlW2ISLuI85qdW126nKX9jxCx1uTejogGzeLC2nLK
 DucPZ1N7HU87GEc2mcl1aYkwTHp1f4jEQhRFExvCJg9YA3W+SgDQ2XEMEeewqljM
 /AT7tL3yWFCv4OU5ci7qhUZPp9ZgWZ1vc+0zS1MgpVo7XwxUWL+NaCbhbVJoH6Dq
 rwPE+RJOh1zkkatY/jZQYmW65gnqxed7lcUJ8XmRCUQiIQNvKzYApthj1EW4bxV4
 yxz+O6OiHlnnf20IwqAirEeHOUHYwINHVTE/UZovB1pu983iPQztNH9wfSmhDkhj
 MS+mNVyLJc4Jb/UQvLOkDVljuT2tmtOYytSeMb5z0D+EjBPDAnWZk9RV7UouK+nF
 HjuXEC45NEPzD5H4G8R4HZXBlSbV/SuzyS0Ljor8GBSdAJ9Xf6pDojgNCXLzHgny
 byD1j7jB5rqmGfy72IRUtLFqThroEiTaKXPNJ44P9lK/YdpBZfn99BmtLEUETNeM
 enm8ex1CWYrzLlq5UwM/2FYLE6Tiy5AQOqGfcnQpuaEG4qKao5Za7hmUy3yWitfa
 OK/2GwlDbHXfu/Ekg1kzzFk=
 =jna2
 -----END PGP SIGNATURE-----

Merge tag '1.17.4'

cairo 1.17.4 release

We are not quite sure what happened, but the 1.17.4 tag and the master
branch have different Git histories, but the same content. The merge
commits are missing from the history of the tag. This merge is simply
the result of "git merge 1.17.4".

This fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/446
2021-01-16 16:17:46 +01:00
Uli Schlachter
f0fb05f3a1 Merge branch 'meson-only-build-helper-libs-if-needed' into 'master'
meson: only build cairo-boilerplate and cairo-missing helper libs if needed

See merge request cairo/cairo!110
2021-01-16 11:37:21 +00:00
Tim-Philipp Müller
51d50621be meson: only build cairo-boilerplate and cairo-missing helper libs if needed
Used by tests and the sphinx utility, which may or may not be built,
and if they're not built we don't need to build those libs either.
2021-01-15 18:47:08 +00:00
Uli Schlachter
81806c0111 cairo-xlib: Check for maximum surface size
X11 use uint16_t for the width/height of things. Anything too large will
be truncated when sending the request to the X11 server. This commit
adds a size check to a function that did not check things and then later
caused a segmentation fault.

Not adding a test case because the test case from the below bug report
allocates 3,5 GiB of memory, which I find too much for a test.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/414
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-01-13 16:36:33 +01:00
Uli Schlachter
0134ac5a3d cairo_win32_surface_get_dc: Return NULL for error surfaces
Surfaces from _cairo_surface_create_in_error() have no backend. This
commit fixes a NULL pointer dereference in cairo_win32_surface_get_dc().

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/405
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-01-13 16:26:18 +01:00
Heiko Lewin
974791b4ee Merge branch 'fix-clear-nothing-to-do' into 'master'
Fix _cairo_surface_paint not setting is_clear

Closes #283

See merge request cairo/cairo!104
2021-01-11 19:48:26 +00:00
Heiko Lewin
e45875142f Merge branch 'snapshot-error-fixes' into 'master'
Slightly improve dealing with error snapshots

See merge request cairo/cairo!92
2021-01-11 19:43:54 +00:00
Heiko Lewin
891468f191 Merge branch 'font-parse-oob' into 'master'
Add a bounds check to cairo_cff_font_read_fdselect()

Closes #451

See merge request cairo/cairo!103
2021-01-11 19:41:24 +00:00
Heiko Lewin
21db0989d7 Merge branch 'debug-fix' into 'master'
Apply small fix that was reported as an issue

Closes #385

See merge request cairo/cairo!105
2021-01-11 19:33:35 +00:00
Uli Schlachter
be0f938e4a Apply small fix that was reported as an issue
Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/385
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-01-11 19:08:02 +01:00
Uli Schlachter
a7c49ec861 Fix _cairo_surface_paint not setting is_clear
In commit 10e58a4a I changed the code in cairo-surface.c to avoid
setting surface->is_clear = FALSE; in some situations where it was not
necessary, because the operation did not actually modify anything (it
returned CAIRO_INT_STATUS_NOTHING_TO_DO). However, that change
accidentally also caused _cairo_surface_paint() not to set
surface->is_clear = TRUE; in similar cases. That was unintended.

This commit fixes that by always setting is_clear = TRUE when necessary,
but keeps the optimisation of not setting is_clear = FALSE when not
necessary.

The connection to the below issue is that the issue happened with
surfaces with width=0. Clearing such a surface with CAIRO_OPERATOR_CLEAR
causes CAIRO_INT_STATUS_NOTHING_TO_DO and thus is_clear = TRUE was not
set. This error was later caught by a failed assertion.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/283
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-01-11 18:37:52 +01:00
Uli Schlachter
66c9911850 Slightly improve dealing with error snapshots
An error in _cairo_surface_snapshot_copy_on_write() results in a
snapshot in an error state and the snapshot's ->target could now point
to a surface from _cairo_surface_create_in_error(). These surfaces e.g.
have ->backend == NULL. Thus, anything looking at ->backend->type now
explodes. This commit deals with two places which caused segfaults in
this situation.

There is no test case for this, because
_cairo_surface_snapshot_copy_on_write() really is not supposed to fail.

Found-while-investigating: https://gitlab.freedesktop.org/cairo/cairo/-/issues/448
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-01-07 17:27:39 +01:00
Uli Schlachter
b1e81ee98f Add a bounds check to cairo_cff_font_read_fdselect()
The code in cairo-cff-subset.c parses a binary format without seeming to
bother much with verifying the data. The result is that poppler can be
used to cause an out-of-bounds write in cairo_cff_font_read_fdselect()
via a crafted font file. Fix this by adding the needed length check.

The other code in the file also contains lots of similar things. Since I
cannot really fix everything properly, I'll just fix the one instance
that was found by a fuzzer.

No testcase is added, because this depends on a broken font that is
quite large. Adding something this big to the test suite does not seem
sensible.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/451
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-01-07 02:03:55 +01:00
Heiko Lewin
9508d25d6a Merge branch 'xml-requires-png' into 'master'
autoconf: Reject --enable-xml --disable-png

See merge request cairo/cairo!87
2021-01-06 21:57:21 +00:00
Uli Schlachter
414d0aee10 Merge branch 'fix-compiler-warnings-in-test-suite' into 'master'
Fix compiler warnings in test suite

See merge request cairo/cairo!98
2021-01-06 13:41:30 +00:00
Uli Schlachter
b80d26a064 Merge branch 'meson-ci-macos' into 'master'
meson: fix macOS build and add macOS ci

Closes #441

See merge request cairo/cairo!101
2021-01-06 13:27:28 +00:00
Tim-Philipp Müller
d8d16562ec meson: fix macOS build and add macOS ci
Fixes #441
2021-01-04 20:08:06 +00:00
Sven Neumann
4e02f705e4 Add tests for PDF metadata
Extend the "pdf-tagged-text" test so that it does some basic checks
on the PDF file it creates. This covers the date fields as well as
some other metadata. More checks can and should be added.
2021-01-04 18:04:27 +01:00
Uli Schlachter
cb3618f76d Merge branch 'fix_memory_allocation' into 'master'
Added checks for failed strdups in cairo-recording-surface.c

See merge request cairo/cairo!99
2021-01-04 15:47:29 +00:00
Heiko Lewin
58b5aa2706 Added checks for failed strdups in cairo-recording-surface.c 2021-01-04 16:16:15 +01:00
Heiko Lewin
7ac8220c1f Merge branch 'fix-copy-paste-error-in-recording-surfaces' into 'master'
Fix copying tags in a recording surface

Closes #448

See merge request cairo/cairo!93
2021-01-04 15:12:38 +00:00
Heiko Lewin
ed7e51eb41 Merge branch 'font-oob' into 'master'
Add a bounds check to cairo_cff_parse_charstring()

Closes #444

See merge request cairo/cairo!90
2021-01-04 14:41:12 +00:00
Sven Neumann
a9ea73ae0c Fix compiler warnings in test suite
Fix some enum mixups, mostly cairo_status_t vs cairo_test_status_t.
2021-01-04 14:08:38 +01:00
Uli Schlachter
b0ef04e2d5 Merge branch 'meson-ci-android' into 'master'
ci: add meson android aarch64 build

See merge request cairo/cairo!96
2021-01-04 12:21:16 +00:00
Tim-Philipp Müller
a7a9c11309 ci: add meson android aarch64 build 2020-12-31 18:48:48 +00:00
Heiko Lewin
0bf2c140d2 Merge branch 'uninitialised-var-in-recording' into 'master'
Fix two uninitialised variables in _cairo_recording_surface_snapshot()

See merge request cairo/cairo!95
2020-12-29 00:03:25 +00:00
Uli Schlachter
be61878a8e Fix two uninitialised variables in _cairo_recording_surface_snapshot()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2020-12-27 21:35:16 +01:00
Uli Schlachter
a1dc600a07 Fix copying tags in a recording surface
The code was copying from the wrong member of an union. This caused a
huge num_dashes value to be read, which then caused a so large memory
allocation that malloc returned an error.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/448
Signed-off-by: Uli Schlachter <psychon@znc.in>
2020-12-26 19:11:31 +01:00
Tim-Philipp Müller
c47db9e36c autotools: dist meson subproject wraps
Fixes #447
2020-12-25 19:48:23 +00:00
Uli Schlachter
467e7822a9 Add a bounds check to cairo_cff_parse_charstring()
The code in cairo-cff-subset.c parses a binary font format without
seeming to bother much verifying the data. The result is that poppler
can be used to cause an out-of-bounds access in
cairo_cff_parse_charstring() via a crafted font file. Fix this by adding
the needed length check.

The other code in the file also contains lots of similar things. Since I
cannot really fix everything properly, I'll just fix the one instance
that was found by a fuzzer.

No testcase is added, because this depends on a broken font that is
quite large. Adding something this big to the test suite does not seem
sensible.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/444
Signed-off-by: Uli Schlachter <psychon@znc.in>
2020-12-25 16:09:19 +01:00
Uli Schlachter
979382dd30 Merge branch 'boilerplate-leak' into 'master'
boilerplate-xcb: Avoid leaks on error

See merge request cairo/cairo!82
2020-12-25 14:43:52 +00:00
Uli Schlachter
c7b6c073ea Merge branch 'xcb-fix-clip-leak' into 'master'
Fix a leak in cairo-xcb's render compositor

Closes #24

See merge request cairo/cairo!83
2020-12-25 14:43:14 +00:00
Uli Schlachter
78266cc8c0 Merge branch 'fix-437' into 'master'
Fix mask usage in image-compositor

See merge request cairo/cairo!85
2020-12-24 08:33:04 +00:00
Uli Schlachter
8d7c08d934 Merge branch 'csi' into 'master'
meson: Generate cairo-script-interpreter.pc needed by GTK+

See merge request cairo/cairo!70
2020-12-23 07:50:03 +00:00
Xavier Claessens
ebbaebdec1 meson: Generate cairo-script-interpreter.pc needed by GTK+ 2020-12-22 13:16:05 -05:00
Uli Schlachter
a012540d99 autoconf: Reject --enable-xml --disable-png
The xml surface depends on png. Before this commit, configuring with
autogen.sh --disable-png --disable-svg --enable-xml resulted in a
failing build:

src/cairo-xml-surface.c: In function ‘_cairo_xml_emit_image’:
src/cairo-xml-surface.c:673:14: error: implicit declaration of function
‘cairo_surface_write_to_png_stream’

After this commit, configure instead rejects this combination with:

checking whether cairo's xml surface backend feature could be enabled... no (requires --enable-png)
configure: error:  xml surface backend feature could not be enabled

Noticed-at: https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/67#note_644347
Signed-off-by: Uli Schlachter <psychon@znc.in>
2020-12-19 11:10:13 +01:00
Heiko Lewin
0677e0a949 Add meson support 2020-12-15 18:14:35 +01:00
Heiko Lewin
8bc14a6bba Minor cleanups 2020-12-15 17:14:18 +01:00
Heiko Lewin
03a820b173 Fix mask usage in image-compositor 2020-12-15 16:48:19 +01:00
Uli Schlachter
7b258a2fb8 Merge branch 'libversion-fixup-match-autotools' into 'master'
meson: fix library versioning

Closes #442

See merge request cairo/cairo!84
2020-12-15 15:17:39 +00:00