diff --git a/src/cairo-clip-boxes.c b/src/cairo-clip-boxes.c index 3ebcd509c..777b7ddc1 100644 --- a/src/cairo-clip-boxes.c +++ b/src/cairo-clip-boxes.c @@ -318,7 +318,10 @@ _cairo_clip_intersect_boxes (cairo_clip_t *clip, goto out; } - _cairo_boxes_copy_to_clip (boxes, clip); + if (!_cairo_boxes_copy_to_clip (boxes, clip)) { + clip = _cairo_clip_set_all_clipped (clip); + goto out; + } _cairo_boxes_extents (boxes, &limits); diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c index 360f03fda..b5d08ee1b 100644 --- a/src/cairo-ft-font.c +++ b/src/cairo-ft-font.c @@ -2808,8 +2808,8 @@ _cairo_ft_scaled_glyph_init_record_colr_v1_glyph (cairo_ft_scaled_font_t *scaled /* Copied from cairo-user-font.c */ cairo_matrix_t extent_scale; - double extent_x_scale; - double extent_y_scale; + double extent_x_scale = 1.0; + double extent_y_scale = 1.0; double snap_x_scale; double snap_y_scale; double fixed_scale, x_scale, y_scale; diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c index 9ebeb6cd3..60f647eb7 100644 --- a/src/cairo-path-stroke.c +++ b/src/cairo-path-stroke.c @@ -162,6 +162,10 @@ _cairo_stroker_init (cairo_stroker_t *stroker, stroker->has_first_face = FALSE; stroker->has_initial_sub_path = FALSE; + /* Coverity complains these may be unitialized. */ + memset (&stroker->current_face, 0, sizeof (cairo_stroke_face_t)); + memset (&stroker->first_face, 0, sizeof (cairo_stroke_face_t)); + _cairo_stroker_dash_init (&stroker->dash, stroke_style); stroker->add_external_edge = NULL; diff --git a/src/cairo-pdf-interchange.c b/src/cairo-pdf-interchange.c index 29d5c5d9c..720ce0d53 100644 --- a/src/cairo-pdf-interchange.c +++ b/src/cairo-pdf-interchange.c @@ -1959,6 +1959,8 @@ _cairo_pdf_interchange_tag_end (cairo_pdf_surface_t *surface, } else if (surface->paginated_mode == CAIRO_PAGINATED_MODE_RENDER) { status = _cairo_tag_stack_pop (&ic->render_tag_stack, name, &elem); + } else { + ASSERT_NOT_REACHED; } if (unlikely (status)) return status; diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index 1d2bba20e..5421c39c9 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -3507,13 +3507,13 @@ _cairo_ps_surface_use_form (cairo_ps_surface_t *surface, if (surface->ps_level == CAIRO_PS_LEVEL_3) max_size = MAX_L3_FORM_DATA; else - max_size = MAX_L3_FORM_DATA; + max_size = MAX_L2_FORM_DATA; /* Don't add any more Forms if we exceed the form memory limit */ if (surface->total_form_size + params->approx_size > max_size) return CAIRO_INT_STATUS_UNSUPPORTED; - surface->total_form_size += params->approx_size > max_size; + surface->total_form_size += params->approx_size; unique_id = _cairo_malloc (source_key.unique_id_length); if (unique_id == NULL) return _cairo_error (CAIRO_STATUS_NO_MEMORY); diff --git a/src/cairo.c b/src/cairo.c index 00521f264..78c60df5c 100644 --- a/src/cairo.c +++ b/src/cairo.c @@ -3013,11 +3013,11 @@ cairo_tag_end (cairo_t *cr, const char *tag_name) * "sans-serif", "cursive", "fantasy", "monospace"), are likely to * work as expected. * - * If @family starts with the string "@cairo:", or if no native font + * If @family starts with the string "\@cairo:", or if no native font * backends are compiled in, cairo will use an internal font family. * The internal font family recognizes many modifiers in the @family * string, most notably, it recognizes the string "monospace". That is, - * the family name "@cairo:monospace" will use the monospace version of + * the family name "\@cairo:monospace" will use the monospace version of * the internal font family. * * For "real" font selection, see the font-backend-specific diff --git a/test/mime-unique-id.c b/test/mime-unique-id.c index aab93164d..8d4a16133 100644 --- a/test/mime-unique-id.c +++ b/test/mime-unique-id.c @@ -79,10 +79,13 @@ * * If the size check fails, manually check the output and if the * surfaces are still embedded only once, update the expected sizes. + * + * Note: The PS2 output will embed the image more than once due to the + * lower MAX_L2_FORM_DATA for PS2 in cairo-ps-surface.c. */ -#define PS2_EXPECTED_SIZE 417510 -#define PS3_EXPECTED_SIZE 381554 -#define PDF_EXPECTED_SIZE 162923 +#define PS2_EXPECTED_SIZE 626926 +#define PS3_EXPECTED_SIZE 381555 +#define PDF_EXPECTED_SIZE 162692 #define SIZE_TOLERANCE 5000 static const char *png_filename = "romedalen.png"; diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c index 1bdb07591..8bdb3f881 100644 --- a/util/cairo-trace/trace.c +++ b/util/cairo-trace/trace.c @@ -1742,7 +1742,7 @@ _emit_image (cairo_surface_t *image, break; case CAIRO_FORMAT_A8: for (row = height; row--; ) { - _write_data (&stream, rowdata, width); + _write_data (&stream, data, width); data += stride; } break;