From: Antonio Ospite Date: Sat, 14 Sep 2013 15:28:13 +0000 (+0200) Subject: Check return value of pixWrite() X-Git-Url: https://git.ao2.it/experiments/leptonica.git/commitdiff_plain/HEAD?ds=inline;hp=a04c47a79c942d448fb9e9eb43e7a4dbc3901308 Check return value of pixWrite() --- diff --git a/leptonica-projective-transform.c b/leptonica-projective-transform.c index 6035526..d89b4df 100644 --- a/leptonica-projective-transform.c +++ b/leptonica-projective-transform.c @@ -97,10 +97,15 @@ int main(int argc, char *argv[]) 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);