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:
Chris Wilson 2009-03-31 10:27:15 +01:00
parent 9f63cbb870
commit b0689f5611
3 changed files with 6 additions and 0 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;