mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 19:18:12 +02:00
[cairo-paginated-surface] Propagate malloc failure
Check for an allocation failure during _cairo_analysis_surface_create() and propagate to caller - where we discover that the callers themselves missed the status checks...
This commit is contained in:
parent
0d8a1540ec
commit
eac18d44c7
1 changed files with 8 additions and 2 deletions
|
|
@ -214,6 +214,8 @@ _paint_page (cairo_paginated_surface_t *surface)
|
|||
|
||||
analysis = _cairo_analysis_surface_create (surface->target,
|
||||
surface->width, surface->height);
|
||||
if (analysis == NULL)
|
||||
return CAIRO_STATUS_NO_MEMORY;
|
||||
|
||||
surface->backend->set_paginated_mode (surface->target, CAIRO_PAGINATED_MODE_ANALYZE);
|
||||
status = _cairo_meta_surface_replay (surface->meta, analysis);
|
||||
|
|
@ -281,7 +283,9 @@ _cairo_paginated_surface_copy_page (void *abstract_surface)
|
|||
if (status)
|
||||
return status;
|
||||
|
||||
_paint_page (surface);
|
||||
status = _paint_page (surface);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
surface->page_num++;
|
||||
|
||||
|
|
@ -306,7 +310,9 @@ _cairo_paginated_surface_show_page (void *abstract_surface)
|
|||
if (status)
|
||||
return status;
|
||||
|
||||
_paint_page (surface);
|
||||
status = _paint_page (surface);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
status = _cairo_surface_show_page (surface->target);
|
||||
if (status)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue