diff options
author | Moonchild <moonchild@palemoon.org> | 2021-11-20 23:05:25 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-04-05 19:42:46 +0200 |
commit | 6abe7e7914006e6477f41c4d3f418ffd9da2c281 (patch) | |
tree | 3bc973d4175a77e409fbb4597bec87ddc202bff2 | |
parent | 7ab66b1c6aac81c0ad8f962686c419f77df23b14 (diff) | |
download | uxp-6abe7e7914006e6477f41c4d3f418ffd9da2c281.tar.gz |
Issue #1795 - Don't try to pass a dash array of > 16 elements to ExtCreatePen.
According to MSDN documentation, the count of the style array passed to
ExtCreatePen is limited to 16. When we call ExtCreatePen with cStyle=17 or more,
it simply returns an error and the cairo surface used for printing is getting
into an error state, after which nothing further gets printed.
Instead of erroring out, this code change returns an unsupported status so that
cairo will provide fallback handling for it.
-rw-r--r-- | gfx/cairo/cairo/src/cairo-win32-printing-surface.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gfx/cairo/cairo/src/cairo-win32-printing-surface.c b/gfx/cairo/cairo/src/cairo-win32-printing-surface.c index 56cf3242bc..386627ae64 100644 --- a/gfx/cairo/cairo/src/cairo-win32-printing-surface.c +++ b/gfx/cairo/cairo/src/cairo-win32-printing-surface.c @@ -1267,6 +1267,9 @@ _cairo_win32_printing_surface_stroke (void *abstract_surface, } if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE) { + /* Win32 does not support more than 16 elements in the dash array. */ + if (style->num_dashes > 16) + return CAIRO_INT_STATUS_UNSUPPORTED; /* Win32 does not support a dash offset. */ if (style->num_dashes > 0 && style->dash_offset != 0.0) return CAIRO_INT_STATUS_UNSUPPORTED; |