mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 02:58:02 +02:00
[cairo-surface] Check for the error surface in _get_font_options()
cairo_surface_get_font_options() has the side effect of initialising the font options on the surface, but fails to check that the surface is valid first. Therefore if we are passed a read-only error object, we will trigger a segmentation fault. Most likely this is the bug behind: http://bugs.freedesktop.org/show_bug.cgi?id=17096.
This commit is contained in:
parent
922df7fc23
commit
c73b3e43e1
1 changed files with 6 additions and 1 deletions
|
|
@ -648,7 +648,12 @@ cairo_surface_get_font_options (cairo_surface_t *surface,
|
|||
if (cairo_font_options_status (options))
|
||||
return;
|
||||
|
||||
if (!surface->has_font_options) {
|
||||
if (surface->status) {
|
||||
_cairo_font_options_init_default (options);
|
||||
return;
|
||||
}
|
||||
|
||||
if (! surface->has_font_options) {
|
||||
surface->has_font_options = TRUE;
|
||||
|
||||
_cairo_font_options_init_default (&surface->font_options);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue