mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-24 16:00:11 +01:00
Check (and assert) return values of cairo_matrix_invert
Now that we have matrix validation at the time of _cairo_scaled_font_init we know that it is safe to invert this matrix.
This commit is contained in:
parent
4ce2b62bce
commit
dca69f73e3
2 changed files with 8 additions and 2 deletions
|
|
@ -2285,6 +2285,7 @@ static cairo_status_t
|
|||
_cairo_pdf_surface_emit_type3_font_subset (cairo_pdf_surface_t *surface,
|
||||
cairo_scaled_font_subset_t *font_subset)
|
||||
{
|
||||
cairo_status_t status;
|
||||
cairo_pdf_resource_t *glyphs, encoding, char_procs, subset_resource, to_unicode_stream;
|
||||
cairo_pdf_font_t font;
|
||||
cairo_matrix_t matrix;
|
||||
|
|
@ -2361,7 +2362,9 @@ _cairo_pdf_surface_emit_type3_font_subset (cairo_pdf_surface_t *surface,
|
|||
|
||||
subset_resource = _cairo_pdf_surface_new_object (surface);
|
||||
matrix = font_subset->scaled_font->scale;
|
||||
cairo_matrix_invert (&matrix);
|
||||
status = cairo_matrix_invert (&matrix);
|
||||
/* _cairo_scaled_font_init ensures the matrix is invertible */
|
||||
assert (status == CAIRO_STATUS_SUCCESS);
|
||||
_cairo_output_stream_printf (surface->output,
|
||||
"%d 0 obj\r\n"
|
||||
"<< /Type /Font\r\n"
|
||||
|
|
|
|||
|
|
@ -668,6 +668,7 @@ _cairo_ps_surface_emit_type3_font_subset (cairo_ps_surface_t *surface,
|
|||
|
||||
|
||||
{
|
||||
cairo_status_t status;
|
||||
cairo_matrix_t matrix;
|
||||
unsigned int i;
|
||||
|
||||
|
|
@ -680,7 +681,9 @@ _cairo_ps_surface_emit_type3_font_subset (cairo_ps_surface_t *surface,
|
|||
font_subset->subset_id);
|
||||
|
||||
matrix = font_subset->scaled_font->scale;
|
||||
cairo_matrix_invert (&matrix);
|
||||
status = cairo_matrix_invert (&matrix);
|
||||
/* _cairo_scaled_font_init ensures the matrix is invertible */
|
||||
assert (status == CAIRO_STATUS_SUCCESS);
|
||||
_cairo_output_stream_printf (surface->final_stream,
|
||||
"\t/FontType\t3\n"
|
||||
"\t/FontMatrix\t[%f %f %f %f 0 0]\n"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue