mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-02 04:57:59 +02:00
Check for errors during get_mime_data()
cairo_surface_get_mime_data() may raise an error on the surface, so we need to check lest it goes unnoticed and we generate a corrupt file.
This commit is contained in:
parent
9f63cbb870
commit
b0689f5611
3 changed files with 6 additions and 0 deletions
|
|
@ -1728,6 +1728,8 @@ _cairo_pdf_surface_emit_jpeg_image (cairo_pdf_surface_t *surface,
|
|||
|
||||
cairo_surface_get_mime_data (source, CAIRO_MIME_TYPE_JPEG,
|
||||
&mime_data, &mime_data_length);
|
||||
if (unlikely (source->status))
|
||||
return source->status;
|
||||
if (mime_data == NULL)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
|
|
|
|||
|
|
@ -2138,6 +2138,8 @@ _cairo_ps_surface_emit_jpeg_image (cairo_ps_surface_t *surface,
|
|||
|
||||
cairo_surface_get_mime_data (source, CAIRO_MIME_TYPE_JPEG,
|
||||
&mime_data, &mime_data_length);
|
||||
if (unlikely (source->status))
|
||||
return source->status;
|
||||
if (mime_data == NULL)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
|
|
|
|||
|
|
@ -1025,6 +1025,8 @@ _cairo_surface_base64_encode_png (cairo_surface_t *surface,
|
|||
|
||||
cairo_surface_get_mime_data (surface, CAIRO_MIME_TYPE_PNG,
|
||||
&mime_data, &mime_data_length);
|
||||
if (unlikely (surface->status))
|
||||
return surface->status;
|
||||
if (mime_data == NULL)
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue