Image16 and ps have some slight differences for the outline of the drawn
shape. That is fine.
script and svg still reproduce the bug and I do not know why. Hence,
these are marked as xfail.
Signed-off-by: Uli Schlachter <psychon@znc.in>
In commit 1d9f4ae520,
_cairo_matrix_has_unity_scale() was rewritten. As I understand the
commit message, the intention was to allow small rounding errors. In
practice however, this function would now also accepts matrices that it
should not, such as the matrix in the test added in the previous commit.
That matrix has a determinant of 1, but one axis is scaled by 5 and the
other one by 1/5.
In this commit, I revert the algorithmic change done in the function
above. This _cairo_matrix_has_unity_scale() now again compares all the
relevant fields of the matrix again without looking at the determinant.
To keep the intention of the above commit, this comparison still allows
some small inaccuracies.
This fixes the unit test added in the previous commit for most backends
(xlib*, xcb*, image, recording). The test still fails for svg, script,
ps, and image16.
Fixes: #927
Signed-off-by: Uli Schlachter <psychon@znc.in>
Make sure surface->object_stream.stream is cleaned up even if things
failed
In poppler oss-fuzz tests we are getting this leak reported
Direct leak of 64 byte(s) in 1 object(s) allocated from:
#0 0x5747417eabd9 in __interceptor_calloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:74:3
#1 0x574742706f5b in _cairo_memory_stream_create cairo/src/cairo-output-stream.c:741:14
#2 0x5747426757b8 in _cairo_pdf_surface_open_object_stream cairo/src/cairo-pdf-surface.c:2307:34
#3 0x57474266b880 in _cairo_pdf_surface_finish cairo/src/cairo-pdf-surface.c:2700:14
#4 0x57474261afc6 in _cairo_surface_finish cairo/src/cairo-surface.c:1043:11
#5 0x57474261afc6 in cairo_surface_finish cairo/src/cairo-surface.c:1092:5
#6 0x57474270808a in _cairo_paginated_surface_finish cairo/src/cairo-paginated-surface.c:215:2
#7 0x5747426175c2 in _cairo_surface_finish cairo/src/cairo-surface.c:1043:11
#8 0x5747426175c2 in cairo_surface_destroy cairo/src/cairo-surface.c:978:2
This fixes it.
_cairo_pdf_surface_finish was succeeding past
_cairo_pdf_surface_open_object_stream that allocates surface->object_stream.stream,
failing when calling _cairo_pdf_surface_emit_font_subsets
and that memory was never freed
We now require at least Windows Vista. When dwrite is disabled, declare
WINVER accordingly so we get the defines we no longer carry ourselves.
The default dwrite-enabled path already has a new-enough WINVER.
Fixes: d0ee67a142 ("Win32: Remove unused code and defines for old toolchains")
This happens when converting _cairo_status to _cairo_int_status:
warning C5286: implicit conversion from enum type '_cairo_int_status' to
enum type '_cairo_status'; use an explicit cast to silence this warning
They don't support C11 anyway. Additionally, CLang defines a very
conservative __GNUC__ value (which is also configurable via the
-fgnuc-version= command-line argument)
When cairo_is_all_clipped return true, we must not attempt
to change any of the clip fields, since it is pointing to
the static const __cairo_clip_all.
Moving the check for ->region into the 'if' is fine, since
it will always be NULL for _cairo_clip_all.
This was causing a crash in inkscape, see
https://gitlab.com/inkscape/inkscape/-/issues/5631