diff options
author | Dirk Lemstra <dirk@lemstra.org> | 2020-01-08 00:02:38 +0100 |
---|---|---|
committer | Dirk Lemstra <dirk@lemstra.org> | 2020-01-08 00:02:38 +0100 |
commit | 07a352046c24a8387497dc4fe8cd0a8b364b0eb0 (patch) | |
tree | d92db69bfe27165b541143537587a0fa385b7ccf | |
parent | f0b98c2edacae87b83216b8bc3c4c6df69ccfa3e (diff) | |
download | ImageMagick-07a352046c24a8387497dc4fe8cd0a8b364b0eb0.tar.gz |
Removed null checks because images cannot be null at those points.
-rw-r--r-- | coders/jnx.c | 8 |
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)); } |