summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Lemstra <dirk@lemstra.org>2020-01-08 00:02:38 +0100
committerDirk Lemstra <dirk@lemstra.org>2020-01-08 00:02:38 +0100
commit07a352046c24a8387497dc4fe8cd0a8b364b0eb0 (patch)
treed92db69bfe27165b541143537587a0fa385b7ccf
parentf0b98c2edacae87b83216b8bc3c4c6df69ccfa3e (diff)
downloadImageMagick-07a352046c24a8387497dc4fe8cd0a8b364b0eb0.tar.gz
Removed null checks because images cannot be null at those points.
-rw-r--r--coders/jnx.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/coders/jnx.c b/coders/jnx.c
index 7f5b8b291..d9a4c4174 100644
--- a/coders/jnx.c
+++ b/coders/jnx.c
@@ -287,8 +287,7 @@ static Image *ReadJNXImage(const ImageInfo *image_info,ExceptionInfo *exception)
sizeof(*blob));
if (blob == (unsigned char *) NULL)
{
- if (images != (Image *) NULL)
- images=DestroyImageList(images);
+ images=DestroyImageList(images);
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
blob[0]=0xFF;
@@ -296,8 +295,7 @@ static Image *ReadJNXImage(const ImageInfo *image_info,ExceptionInfo *exception)
count=ReadBlob(image,tile_length,blob+2);
if (count != (ssize_t) tile_length)
{
- if (images != (Image *) NULL)
- images=DestroyImageList(images);
+ images=DestroyImageList(images);
blob=(unsigned char *) RelinquishMagickMemory(blob);
ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile");
}
@@ -331,8 +329,6 @@ static Image *ReadJNXImage(const ImageInfo *image_info,ExceptionInfo *exception)
}
(void) CloseBlob(image);
image=DestroyImage(image);
- if (images == (Image *) NULL)
- return((Image *) NULL);
return(GetFirstImageInList(images));
}