mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 06:28:01 +02:00
Fix crash if font error in recording surface
https://bugzilla.mozilla.org/show_bug.cgi?id=1897561
This commit is contained in:
parent
c75997a4ea
commit
0cd376ba0b
1 changed files with 5 additions and 1 deletions
|
|
@ -480,7 +480,7 @@ _cairo_recording_surface_region_array_destroy (cairo_recording_surface_t *
|
|||
cairo_recording_region_element_t *region_elements;
|
||||
int i, num_elements;
|
||||
|
||||
num_elements = surface->commands.num_elements;
|
||||
num_elements = MIN(surface->commands.num_elements, _cairo_array_num_elements(®ion_array->regions));
|
||||
elements = _cairo_array_index (&surface->commands, 0);
|
||||
region_elements = _cairo_array_index (®ion_array->regions, 0);
|
||||
for (i = 0; i < num_elements; i++) {
|
||||
|
|
@ -1154,6 +1154,10 @@ _cairo_recording_surface_show_text_glyphs (void *abstract_surface,
|
|||
|
||||
command->cluster_flags = cluster_flags;
|
||||
|
||||
status = scaled_font->status;
|
||||
if (unlikely (status))
|
||||
goto CLEANUP_ARRAYS;
|
||||
|
||||
command->scaled_font = cairo_scaled_font_reference (scaled_font);
|
||||
|
||||
status = _cairo_recording_surface_commit (surface, &command->header);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue