goto out_free_cropped_image;
}
- pixWrite("transformed_image.jpg", transformed_image, IFF_JFIF_JPEG);
+ ret = pixWrite("transformed_image.jpg", transformed_image, IFF_JFIF_JPEG);
+ if (ret != 0) {
+ ret = -EINVAL;
+ goto cleanup;
+ }
ret = 0;
+cleanup:
pixDestroy(&transformed_image);
out_free_cropped_image:
pixDestroy(&cropped_image);