Commit graph

11787 commits

Author SHA1 Message Date
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
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
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
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
Tim-Philipp Müller
e9ccb1d8d0 meson: fix library versioning
Fixes #442
2020-12-15 00:22:37 +00:00
Uli Schlachter
e22d7212ac Merge branch 'bigsur-use-after-free' into 'master'
Ref and destroy the cairo surface handed off to CoreGraphics.

Closes #420

See merge request cairo/cairo!52
2020-12-11 14:14:24 +00:00
John Ralls
dccaa9179b Quartz Better manage acquired/replayed surface. 2020-12-05 11:51:17 -08:00
Uli Schlachter
eb75ce0861 Fix a leak in cairo-xcb's render compositor
The code here temporary replaces extents->clip with another clip to call
a function. Afterwards, it restores the previous copy. The temporary
clip is only freed when it still is pointed to by extents->clip.

This logic is wrong. It is indeed possible that the clip is simplified
and changes. In this case, the original clip is also correctly freed.
However, this still means that we have to clean up and destroy the new
clip. The previous code just leaked it.

This was originally identified by Massimo in [1]. I am just committing
his patch.

[1]: https://bugs.freedesktop.org/show_bug.cgi?id=91267

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/24
Signed-off-by: Uli Schlachter <psychon@znc.in>
2020-12-05 08:15:34 +01:00
Uli Schlachter
2ceb279d70 boilerplate-xcb: Avoid leaks on success
This gets rid of the following two leaks reported by valgrind when successfully
running a test with CAIRO_TEST_TARGET=xcb:

8,000 bytes in 2 blocks are definitely lost in loss record 9 of 10
   at 0x483877F: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4B7E135: read_packet (xcb_in.c:259)
   by 0x4B7E135: _xcb_in_read (xcb_in.c:1031)
   by 0x4B7BF8E: _xcb_conn_wait (xcb_conn.c:516)
   by 0x4B7D6AE: wait_for_reply (xcb_in.c:516)
   by 0x4B7D8C8: xcb_request_check (xcb_in.c:745)
   by 0x18D747: _cairo_boilerplate_xcb_create_surface (cairo-boilerplate-xcb.c:310)
   by 0x12906F: cairo_test_for_target (cairo-test.c:819)
   by 0x12AAB5: _cairo_test_context_run_for_target (cairo-test.c:1555)
   by 0x126921: _cairo_test_runner_draw (cairo-test-runner.c:250)
   by 0x126921: main (cairo-test-runner.c:932)

8,000 bytes in 2 blocks are definitely lost in loss record 10 of 10
   at 0x483877F: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4B7E135: read_packet (xcb_in.c:259)
   by 0x4B7E135: _xcb_in_read (xcb_in.c:1031)
   by 0x4B7BF8E: _xcb_conn_wait (xcb_conn.c:516)
   by 0x4B7D6AE: wait_for_reply (xcb_in.c:516)
   by 0x4B7D7C0: xcb_wait_for_reply (xcb_in.c:546)
   by 0x18D45D: find_depth (cairo-boilerplate-xcb.c:154)
   by 0x18D45D: _cairo_boilerplate_xcb_create_render_0_0 (cairo-boilerplate-xcb.c:621)
   by 0x12906F: cairo_test_for_target (cairo-test.c:819)
   by 0x12AAB5: _cairo_test_context_run_for_target (cairo-test.c:1555)
   by 0x126921: _cairo_test_runner_draw (cairo-test-runner.c:250)
   by 0x126921: main (cairo-test-runner.c:932)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2020-12-05 08:08:14 +01:00
Uli Schlachter
e3eaccb939 boilerplate-xcb: Avoid leaks on error
Before this commit, running the test suite against a non-existing
display under valgrind resulted in:

$ ( cd test; DISPLAY=:2 CAIRO_TEST_TARGET=xcb valgrind --leak-check=full .libs/cairo-test-suite -f random-clip )
[...]
==47359== 64 bytes in 2 blocks are definitely lost in loss record 1 of 7
==47359==    at 0x483AB65: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==47359==    by 0x18A272: cairo_boilerplate_xcalloc (cairo-boilerplate-system.c:65)
==47359==    by 0x18D652: _cairo_boilerplate_xcb_create_surface (cairo-boilerplate-xcb.c:269)
==47359==    by 0x12906F: cairo_test_for_target (cairo-test.c:819)
==47359==    by 0x12AAB5: _cairo_test_context_run_for_target (cairo-test.c:1555)
==47359==    by 0x126921: _cairo_test_runner_draw (cairo-test-runner.c:250)
==47359==    by 0x126921: main (cairo-test-runner.c:932)

This commit fixes that by freeing the allocated memory in the error
path.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2020-12-05 07:46:41 +01:00
John Ralls
1ddfccca31 Quartz image drawing: Remove containers for cairo_surface_t.
Since we now copy the data that CGImage needs we don't need to
keep the surface around anymore, nor release it or the image in the
DataProviderReleaseCallback.
2020-12-03 13:56:50 -08:00
John Ralls
b5e84a9783 Quartz: Ensure that image data and surface are available to draw.
Snapshot the cairo_surface_t and copy the image data to provide to
the CGDataProvider so that it is independent of the cairo_surface_t's
lifetime.

Closes https://gitlab.freedesktop.org/cairo/cairo/-/issues/420
2020-12-03 10:59:04 -08:00
John Ralls
32c12c617a Ensure _cairo_quartz_surface_create_internal always nulls imageSurfaceEquiv. 2020-11-30 14:10:18 -08:00
Uli Schlachter
f7054c892e Merge branch 'meson-ci-fix' into 'master'
ci: fix default options in meson ci

See merge request cairo/cairo!80
2020-11-22 19:08:41 +00:00
Tim-Philipp Müller
313f6fefc9 ci: fix default options in meson ci
Follow-up fix to !78
2020-11-22 18:44:20 +00:00
Uli Schlachter
6a713391fa Merge branch 'pdf-leak' into 'master'
pdf: fix leak of source surfaces

See merge request cairo/cairo!51
2020-11-21 13:48:13 +00:00
Félix Poisot
8913b6e2fc The array introduced in bff47b43 isn't cleared on surface finish 2020-11-21 11:58:59 +00:00
Uli Schlachter
577477207a Merge branch 'trace_parse_fix' into 'master'
cairo-trace: Fix escape character encoding in string literals

See merge request cairo/cairo!72
2020-11-20 16:38:31 +00:00
George Matsumura
08c76f4cbf cairo-trace: Fix escape character encoding in string literals
This fixes a typo wherein both a return character and a tab character
were encoded when only a return character was specified for encoding.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-11-20 16:07:53 +00:00
Uli Schlachter
c1d489b474 Merge branch 'empty-delta-arrays' into 'master'
cff: Allow empty array of operands for certain operators

See merge request cairo/cairo!39
2020-11-20 16:07:27 +00:00
Marek Kasik
c86b90a019 cff: Allow empty array of operands for certain operators
Operators BlueValues, OtherBlues, FamilyBlues, FamilyOtherBlues,
StemSnapH and StemSnapV have operands of type delta which can be
a number or an array of delta-encoded numbers. This array can be
empty according to freetype developers.
This commit checks whether current operator is among those listed
and permits empty operand in such case.
2020-11-20 15:39:54 +00:00
Uli Schlachter
e3415a319d Merge branch 'fix-iso8601_to_pdf_date_string' into 'master'
Fix conversion from ISO 8601 to PDF date string

Closes #392

See merge request cairo/cairo!35
2020-11-20 15:20:41 +00:00
Sven Neumann
6eb3c9d364 Fix conversion from ISO 8601 to PDF date string
The code used to unintentionally drop the minutes from the timezone
offset, see issue #392. This is now fixed.
2020-11-20 14:56:48 +00:00
Uli Schlachter
fda1f07bdf Merge branch 'meson-ci-require-gl-on-fedora' into 'master'
ci: require opengl in meson fedora build

See merge request cairo/cairo!79
2020-11-17 17:24:05 +00:00
Tim-Philipp Müller
5d97c12859 ci: require opengl in meson fedora build
Follow-up to !78
2020-11-17 16:59:53 +00:00
Tim-Philipp Müller
3e5115fde7 meson: align gl backend option defaults with autotools
Disable gl backend by default, just like autotools does:

  --enable-gl=[no/auto/yes]
                          Enable cairo's OpenGL surface backend feature
                          [default=no]
  --enable-glesv2=[no/auto/yes]
                          Enable cairo's OpenGLESv2 surface backend feature
                          [default=no]
  --enable-glesv3=[no/auto/yes]
                          Enable cairo's OpenGLESv3 surface backend feature
                          [default=no]
2020-11-17 15:13:42 +00:00
Nirbheek Chauhan
1a68c0bdfb libpng.wrap: Bump to latest version 2020-11-16 20:14:18 +05:30
Anton Danilkin
b5175fd8a6 Fix testing in the full mode for PDF, PS and SVG backends
Fix how offset, scale and transparency are handled.

Also do the same change in the "win32-printing" backend as it has a copy of the code from PDS, PS and SVG backends.
2020-11-13 12:04:51 +00:00
Nirbheek Chauhan
ab7b45feb7 meson: Fix libpng fallback dependency variable
The libpng subproject dependency variable name was wrong. It's
libpng_dep:

https://github.com/mesonbuild/libpng/blob/1.6.37/meson.build#L110
2020-11-10 16:18:50 +05:30
George Matsumura
ed98414686 build: Fix various compiler warnings
This fixes a few compiler warnings that were encountered with gcc 9.3.0.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2020-11-07 06:45:01 -07:00
Nirbheek Chauhan
618b13c436 meson: Add dependencies to the declared libcairo dep
That way when other projects consume our declared dep, they get
transitive dependencies too based on what features cairo was built
with. Without this, projects that build cairo as a subproject and also
build, say, fontconfig as a subproject will fail to find cairo-ft.h
(etc).
2020-11-04 14:50:52 +05:30