i_img_info() (C API) no longer tries to handle a NULL image object pointer.
authorTony Cook <tony@develop-help.com>
Sun, 6 Jan 2019 04:16:01 +0000 (15:16 +1100)
committerTony Cook <tony@develop-help.com>
Sun, 6 Jan 2019 04:16:01 +0000 (15:16 +1100)
Changes
image.c

diff --git a/Changes b/Changes
index b6c0f94..c06e676 100644 (file)
--- a/Changes
+++ b/Changes
@@ -109,6 +109,9 @@ High severity:
    glyph index with a NULL character map.  This should be rare.  CID
    185297.
 
+ - i_img_info() (C API) no longer tries to handle a NULL image object
+   pointer.  CID 185298.
+
 [1] The first two build submissions ended up at the end of a ~400
 build queue, and seemed to have been cancelled by Coverity.  A build
 submitted on NYE went through in minutes.
diff --git a/image.c b/image.c
index cdfa2ed..bd634ee 100644 (file)
--- a/image.c
+++ b/image.c
@@ -318,21 +318,15 @@ void
 i_img_info(i_img *im, i_img_dim *info) {
   dIMCTXim(im);
   im_log((aIMCTX,1,"i_img_info(im %p)\n",im));
-  if (im != NULL) {
-    im_log((aIMCTX,1,"i_img_info: xsize=%" i_DF " ysize=%" i_DF " channels=%d "
-           "mask=%ud\n",
-           i_DFc(im->xsize), i_DFc(im->ysize), im->channels,im->ch_mask));
-    im_log((aIMCTX,1,"i_img_info: idata=%p\n",im->idata));
-    info[0] = im->xsize;
-    info[1] = im->ysize;
-    info[2] = im->channels;
-    info[3] = im->ch_mask;
-  } else {
-    info[0] = 0;
-    info[1] = 0;
-    info[2] = 0;
-    info[3] = 0;
-  }
+
+  im_log((aIMCTX,1,"i_img_info: xsize=%" i_DF " ysize=%" i_DF " channels=%d "
+         "mask=%ud\n",
+         i_DFc(im->xsize), i_DFc(im->ysize), im->channels,im->ch_mask));
+  im_log((aIMCTX,1,"i_img_info: idata=%p\n",im->idata));
+  info[0] = im->xsize;
+  info[1] = im->ysize;
+  info[2] = im->channels;
+  info[3] = im->ch_mask;
 }
 
 /*