[png] Avoid a double free of the memory stream after error.

_cairo_memory_stream_destroy() finalizes the stream even if the stream was
in error and that error is reported back to the caller - so ensure we
don't try to free the stream again.
This commit is contained in:
Chris Wilson 2009-01-26 14:00:13 +00:00
parent 0f3e366f8b
commit e6102dbe02

View file

@ -655,12 +655,12 @@ read_png (struct png_read_closure_t *png_closure)
status = _cairo_memory_stream_destroy (png_closure->png_data,
&mime_data,
&mime_data_length);
png_closure->png_data = NULL;
if (unlikely (status)) {
cairo_surface_destroy (surface);
surface = _cairo_surface_create_in_error (status);
goto BAIL;
}
png_closure->png_data = NULL;
status = cairo_surface_set_mime_data (surface,
CAIRO_MIME_TYPE_PNG,