Commit graph

12441 commits

Author SHA1 Message Date
Behdad Esfahbod
71c4443139 [malloc-stats] Fix to not crash
Can't use constructor as malloc might be called before that.
2022-12-30 10:34:46 -07:00
Uli Schlachter
4913f07950 Merge branch 'round-join' into 'master'
Remove `round-join-bug-520*` CI exceptions for Quartz backend

See merge request cairo/cairo!377
2022-12-29 12:37:01 +00:00
Christian Rohlfs
aa8d16ab83 Removed round-join-bug-520* CI exceptions for Quartz backend
Removed lines from `.gitlab-ci/ignore-quartz*`;
Added `round-join-bug-520-bevel.quartz.ref.png` file.
2022-12-28 17:50:27 +05:00
Uli Schlachter
2351a65b27 Merge branch 'test-ps' into 'master'
Test cairo-ps in CI

See merge request cairo/cairo!171
2022-12-28 10:52:56 +00:00
Uli Schlachter
a2d05a0c34 ps: Fix crash in self-copy-overlap
According to valgrind, there is a use-after-free here. The function
_cairo_ps_surface_emit_surface() temporarily replaces some member of a
struct and then later re-sets it. However, there is an early return
possible that would skip that part of the code.

This commit moves the re-set up so that no freed pointers are left
behind. This seems to fix the crash.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2022-12-28 11:15:01 +01:00
Uli Schlachter
c1aaaff880 Test cairo-ps in CI
This adds the necessary dependencies for testing cairo-ps to CI and sets
up jobs for testing the ps2 and ps3 backends.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2022-12-28 11:14:59 +01:00
Uli Schlachter
0e56ea9d5c Merge branch 'round-join' into 'master'
Fix for round joins

See merge request cairo/cairo!372
2022-12-28 09:58:35 +00:00
Adrian Johnson
394256abba Merge branch 'lzw-compress-1-byte' into 'master'
Fixed crash in _cairo_lzw_compress for 1 byte input

See merge request cairo/cairo!376
2022-12-28 09:55:37 +00:00
Daniel Hammerschmid
bd15b62906 Fixed crash in _cairo_lzw_compress for 1 byte input 2022-12-28 10:16:49 +01:00
Adrian Johnson
9b2e6f1994 Merge branch 'bash-completion' into 'master'
Bash completion for cairo-test-suite

See merge request cairo/cairo!375
2022-12-28 08:34:56 +00:00
Adrian Johnson
fab328598c Bash completion for cairo-test-suite
Usage:

$ source completion.bash
2022-12-28 16:16:18 +10:30
Adrian Johnson
0b5ec0139c Merge branch 'pbounds-size' into 'master'
Ensure pbounds.size is initialized even in EXTEND_NONE mode.

See merge request cairo/cairo!363
2022-12-28 05:42:51 +00:00
Adrian Johnson
7fa02c81f1 Merge branch 'bug-535' into 'master'
Fix bug #535 in cairo-script

Closes #535

See merge request cairo/cairo!276
2022-12-28 05:05:07 +00:00
Adrian Johnson
b13fb85982 Merge branch 'negative-version-values' into 'master'
cairo_pdf_version_to_string: Check for negative values

Closes #590

See merge request cairo/cairo!358
2022-12-28 04:49:59 +00:00
Adrian Johnson
2b862f632d Merge branch 'lzw_eod_code_width' into 'master'
Fix output of EOD code with incorrect code width in _cairo_lzw_compress

See merge request cairo/cairo!359
2022-12-28 04:45:26 +00:00
Christian Rohlfs
e83776572c Round joins fix (spline_cusp_tolerance)
https://gitlab.freedesktop.org/cairo/cairo/-/issues/520
2022-12-28 07:25:30 +05:00
Christian Rohlfs
805897b1f7 test: Add new round-join-bug-520 tests
https://gitlab.freedesktop.org/cairo/cairo/-/issues/520
2022-12-28 06:52:29 +05:00
Adrian Johnson
e1f07966a6 Merge branch 'dwrite-disable' into 'master'
meson: allow disabling DWrite

See merge request cairo/cairo!374
2022-12-26 20:14:28 +00:00
Benjamin Gilbert
6ec9cd3096 meson: allow disabling DWrite
When building with MinGW-w64, DWrite introduces a libstdc++ dependency
which may not be desired.
2022-12-24 20:18:46 -05:00
Uli Schlachter
7fc6df6dd2 Merge branch 'document-premul' into 'master'
Document whether colors are premultiplied

See merge request cairo/cairo!373
2022-12-24 13:00:32 +00:00
Matthias Clasen
1df5969ef6 Document whether colors are premultiplied
For the various APIs that take or return
RGBA colors, make it explicit that they are
unpremultiplied.
2022-12-24 07:22:39 -05:00
Uli Schlachter
12cd2bcbb2 Merge branch 'testfix' into 'master'
Zero terminate temp buffers before calling strcat.

See merge request cairo/cairo!369
2022-11-25 13:23:31 +00:00
Jussi Pakkanen
44ff5e4e6c Zero terminate temp buffers before calling strcat. 2022-11-24 22:41:36 +02:00
Uli Schlachter
8cb6deed39 Merge branch 'pass-quartz-tests' into 'master'
Pass quartz tests

See merge request cairo/cairo!367
2022-11-18 15:54:40 +00:00
John Ralls
c014a7dda3 Require macOS CI job to pass again. 2022-11-17 16:20:23 -08:00
John Ralls
04cf47b57a Change expected fails and reference image so that Quartz CI passes. 2022-11-17 16:20:14 -08:00
Emmanuele Bassi
f672f20f02 Merge branch 'fix-long-lines' into 'master'
Pass the same type when creating the static glyphs and positions arrays.

Closes #574

See merge request cairo/cairo!366
2022-11-17 22:18:17 +00:00
John Ralls
21ab756bd9 Pass the same type when creating the static glyphs and positions arrays.
Fixes https://gitlab.freedesktop.org/cairo/cairo/-/issues/574
2022-11-17 10:49:18 -08:00
Uli Schlachter
8f1190dc82 Merge branch 'remove-explicit-dependency-on-libssp' into 'master'
Remove explicit dependency on libssp

See merge request cairo/cairo!360
2022-10-28 13:06:36 +00:00
Luca Bacci
392b2b02f7 perf: fix compilation on Win32 2022-10-28 12:44:45 +02:00
Luca Bacci
c75220fe08 Remove explicit dependency on libssp
It's not needed anymore.

Linking explicitly with libssp was required for toolchains where the
target libc doesn't implement stack smashing protection routines on
its own, and instead delegates to the generic implementations provided
by libssp. Notably, this was the case of mingw-w64 toolchains.

After discussion upstream with Meson developers [1], the stance taken
is that Meson users (and Meson itself) shall have no knowledge of the
libc internals and whether libssp is required. instead, libc's should
declare a dependency on the generic libssp on their own by means of
.spec files [2].

Following the discussion in Meson Github, the issue was then fixed in
mingw-w64 upstream [3].

References:
 * https://github.com/mesonbuild/meson/issues/10673
 * https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html
 * https://github.com/msys2/MINGW-packages/issues/13401
2022-10-28 12:44:45 +02:00
Tim-Philipp Müller
0a111ad1fa Merge branch 'ci-update-windows-image' into 'master'
ci: update Windows image to latest,  update glib wrap, and add separate msvc jobs for shared and static build

See merge request cairo/cairo!364
2022-10-28 00:21:31 +00:00
Tim-Philipp Müller
cb726f5729 ci: mark macOS job as allowed to fail, unit tests are broken 2022-10-28 00:20:20 +01:00
Tim-Philipp Müller
b9074f9525 ci: bump macOS image to latest / 12.3 2022-10-27 19:40:09 +01:00
Tim-Philipp Müller
e25511ecd6 Fix build on Windows with -Ddefault_library=static
cairo-perf-chart.c.obj : error LNK2019: unresolved external symbol __imp_cairo_create referenced in function main
etc.
2022-10-27 18:18:58 +01:00
Tim-Philipp Müller
bd8bd609f6 ci: update Windows image to latest, and glib wrap too
Glib subproject git checkout isn't cached any more on the
GStreamer CI image, so use tarball for now, and update to
more recent glib.

This means we can no longer use --default-library=both on
Windows, so add separate jobs for static/shared build.
2022-10-27 15:39:02 +01:00
Jonathan Kew
77aac45db7 Ensure pbounds.size is initialized even in EXTEND_NONE mode.
Since the if/else was replaced by a switch() here in 2e0075e265,
the size field of pbounds is not being set in the EXTEND_NONE case,
which means we end up passing uninitialized values to CGPatternCreate.
2022-10-19 14:59:45 +01:00
Daniel Hammerschmid
efa1e3d197 Fix output of EOD code with incorrect code width in _cairo_lzw_compress
LZW compression: If the last input byte caused the code width to
increase, the end-of-data code was still output with the old (not yet
increased) code width.
2022-10-04 15:51:45 +02:00
Uli Schlachter
53ee809ad9 cairo_pdf_version_to_string: Check for negative values
Before this commit, cairo_pdf_version_to_string() would return the
result of an out-of-bounds array access when called with a negative
value. This commit adds a check against this.

No unit test added since there are no tests for
cairo_pdf_version_to_string() that I could easily add such a test to.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/590
Signed-off-by: Uli Schlachter <psychon@znc.in>
2022-09-16 07:47:18 +02:00
Uli Schlachter
2cfd08664d Merge branch 'scaled-font-make-mutex-recursive' into 'master'
Make cairo_scaled_font_t::mutex recursive

See merge request cairo/cairo!356
2022-09-13 16:27:48 +00:00
Uli Schlachter
a7d31a8714 Merge branch 'fix-issue-587' into 'master'
Check for cache not frozen in glyph_page_can_remove()

Closes #587

See merge request cairo/cairo!355
2022-09-05 20:21:38 +00:00
Luca Bacci
166d718099 Check for scaled_font::cache_frozen in glyph_page_can_remove()
With modifications kindly suggested by Uli Schlachter

Fixes https://gitlab.freedesktop.org/cairo/cairo/-/issues/587
2022-09-05 21:42:49 +02:00
Luca Bacci
531ec8d02d Make cairo_scaled_font_t mutex recursive
Since it can now happen to acquire it recursively,
see https://gitlab.freedesktop.org/cairo/cairo/-/issues/587
2022-09-05 19:41:19 +02:00
Uli Schlachter
0e27a8046e Merge branch 'mismatched-new-delete' into 'master'
Pair usage of operator new[] with a corresponding delete[]

See merge request cairo/cairo!354
2022-09-03 12:55:05 +00:00
Luca Bacci
8266d2d5f2 Pair usage of operator new[] with a corresponding delete[] 2022-09-03 14:16:04 +02:00
Uli Schlachter
716c216ebc Merge branch 'ofz50805' into 'master'
ofz#50805 crash seen in fuzzing libreoffice text rendering

See merge request cairo/cairo!350
2022-09-02 12:28:57 +00:00
Caolán McNamara
5c7e2dafd5 ofz#50805 crash seen in fuzzing libreoffice text rendering
pixman_image_get_format /work/workdir/UnpackedTarball/pixman/pixman/pixman-image.c:939:16
 _cairo_ft_scaled_glyph_init_surface /work/workdir/UnpackedTarball/cairo/src/cairo-ft-font.c:2574:9
 _cairo_ft_scaled_glyph_init /work/workdir/UnpackedTarball/cairo/src/cairo-ft-font.c:2754:11
 _cairo_scaled_glyph_lookup /work/workdir/UnpackedTarball/cairo/src/cairo-scaled-font.c:3073:11
 composite_glyphs /work/workdir/UnpackedTarball/cairo/src/cairo-image-compositor.c:910:15
 composite_glyphs /work/workdir/UnpackedTarball/cairo/src/cairo-traps-compositor.c:2295:12
 clip_and_composite /work/workdir/UnpackedTarball/cairo/src/cairo-traps-compositor.c:1049:15
 _cairo_traps_compositor_glyphs /work/workdir/UnpackedTarball/cairo/src/cairo-traps-compositor.c:2331:11
 _cairo_compositor_glyphs /work/workdir/UnpackedTarball/cairo/src/cairo-compositor.c:292:11
 _cairo_image_surface_glyphs /work/workdir/UnpackedTarball/cairo/src/cairo-image-surface.c:1030:12
 _cairo_surface_show_text_glyphs /work/workdir/UnpackedTarball/cairo/src/cairo-surface.c:2920:15
 _cairo_gstate_show_text_glyphs /work/workdir/UnpackedTarball/cairo/src/cairo-gstate.c:0
 cairo_show_glyphs /work/workdir/UnpackedTarball/cairo/src/cairo.c:3670:14
 CairoTextRender::DrawTextLayout(GenericSalLayout const&, SalGraphics const&) /src/libreoffice/vcl/unx/generic/gdi/cairotextrender.cxx:337:9
2022-08-31 10:30:13 +01:00
Uli Schlachter
c188715bbe Merge branch 'pdfarray' into 'master'
Add missing commas to array values.

See merge request cairo/cairo!348
2022-08-03 11:34:02 +00:00
Jussi Pakkanen
ffc133f703 Add missing commas to array values. 2022-08-03 13:56:15 +03:00
Uli Schlachter
541719ff75 Merge branch 'issue-579' into 'master'
Fix issue 579

Closes #579

See merge request cairo/cairo!340
2022-08-02 11:37:58 +00:00