buffer-diff - check for any errors whilst writing the png

Propagate any errors from writing out the png.
This commit is contained in:
Chris Wilson 2007-04-08 21:47:01 +01:00
parent 79424fc646
commit 2f2bff038c

View file

@ -339,6 +339,7 @@ image_diff_core (const char *filename_a,
compare_surfaces (surface_a, surface_b, surface_diff, result);
status = CAIRO_STATUS_SUCCESS;
if (result->pixels_changed) {
FILE *png_file;
@ -347,7 +348,7 @@ image_diff_core (const char *filename_a,
else
png_file = stdout;
cairo_surface_write_to_png_stream (surface_diff, stdio_write_func, png_file);
status = cairo_surface_write_to_png_stream (surface_diff, stdio_write_func, png_file);
if (png_file != stdout)
fclose (png_file);
@ -360,7 +361,7 @@ image_diff_core (const char *filename_a,
cairo_surface_destroy (surface_b);
cairo_surface_destroy (surface_diff);
return CAIRO_STATUS_SUCCESS;
return status;
}
cairo_status_t