Skip to content

Bail early from _cairo_image_compute_color if image is zero-sized.

This avoids the risk of encountering undefined behavior when computing the pixel pointer (even though it won't actually be used) in the case where the image width or height is zero and the data is NULL. (Observed when called from cairo_pdf_surface code when an extreme scaling transform was present, though I guess there are probably other ways to end up with such an image.)

Merge request reports