diff options
Diffstat (limited to 'tests/avif/avif_im2im.c')
-rw-r--r-- | tests/avif/avif_im2im.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/avif/avif_im2im.c b/tests/avif/avif_im2im.c index 3a07ebd..2331484 100644 --- a/tests/avif/avif_im2im.c +++ b/tests/avif/avif_im2im.c @@ -13,7 +13,7 @@ int main() { - gdImagePtr srcGdIm, destGdIm; + gdImagePtr srcGdIm = NULL, destGdIm = NULL; void *avifImageDataPtr; FILE *fp; int r, g, b; @@ -38,7 +38,7 @@ int main() // Encode the gd image to an AVIF image in memory. avifImageDataPtr = gdImageAvifPtrEx(srcGdIm, &size, 100, 10); - gdTestAssertMsg(avifImageDataPtr != NULL, "gdImageAvifPtr() returned null\n"); + if (!gdTestAssertMsg(avifImageDataPtr != NULL, "gdImageAvifPtr() returned null\n")) goto exit; gdTestAssertMsg(size > 0, "gdImageAvifPtr() returned a non-positive size\n"); // Encode the AVIF image back into a gd image. @@ -54,6 +54,7 @@ int main() gdTestImageDiff(srcGdIm, destGdIm, NULL, &result); gdTestAssertMsg(result.pixels_changed == 0, "pixels changed: %d\n", result.pixels_changed); +exit: if (srcGdIm) gdImageDestroy(srcGdIm); |