mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-09 18:10:25 +01:00
[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:
parent
0f3e366f8b
commit
e6102dbe02
1 changed files with 1 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue