From: Dirk Lemstra Date: Mon, 5 Jun 2017 08:05:11 +0000 (+0200) Subject: Added extra checks. X-Git-Tag: 7.0.6-1~141 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61f89f58339cac9191fe8561bf73d7e6fb0f5273;p=imagemagick Added extra checks. --- diff --git a/MagickCore/blob.c b/MagickCore/blob.c index 605003758..ff96f3da6 100644 --- a/MagickCore/blob.c +++ b/MagickCore/blob.c @@ -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; } }