]> granicus.if.org Git - imagemagick/commitdiff
Added extra checks.
authorDirk Lemstra <dirk@git.imagemagick.org>
Mon, 5 Jun 2017 08:05:11 +0000 (10:05 +0200)
committerDirk Lemstra <dirk@git.imagemagick.org>
Mon, 12 Jun 2017 04:59:40 +0000 (06:59 +0200)
MagickCore/blob.c

index 6050037587acf2c4f2f5eef6a71d7f87b19261dd..ff96f3da66242a2a85db549fb07effdb00ecbd60 100644 (file)
@@ -3365,8 +3365,9 @@ MagickExport ssize_t ReadBlob(Image *image,const size_t length,void *data)
     }
     case CustomStream:
     {
-      count=image->blob->custom_stream->reader(q,length,
-        image->blob->custom_stream->data);
+      if (image->blob->custom_stream->reader != (CustomStreamHandler) NULL)
+        count=image->blob->custom_stream->reader(q,length,
+          image->blob->custom_stream->data);
       break;
     }
   }
@@ -5312,8 +5313,9 @@ MagickExport ssize_t WriteBlob(Image *image,const size_t length,
     }
     case CustomStream:
     {
-      count=image->blob->custom_stream->writer((const unsigned char *) data,
-        length,image->blob->custom_stream->data);
+      if (image->blob->custom_stream->writer != (CustomStreamHandler) NULL)
+        count=image->blob->custom_stream->writer((const unsigned char *) data,
+          length,image->blob->custom_stream->data);
       break;
     }
   }