### ImageMagick version

ImageMagick 7.1.1-12 (Beta) Q16-HDRI x86_64

### Operating system

Linux

### Operating system, version and so on

Ubuntu 20.04.6 LTS

### Description

In the process of fuzzing ImageMagick via AFL++,an assertion failure was found in function WriteBlob in MagickCore/blob.c , which may allow attackers to cause a crash or denial of service via a designed crafted file.

```
#./magick $FILE ./output/
magick: MagickCore/blob.c:5719: ssize_t WriteBlob(Image *, const size_t, const void *): Assertion `image->blob->type != UndefinedStream' failed.
Aborted (core dumped)
```

### Steps to Reproduce

`./magick $FILE ./output/`
## Poc
https://github.com/ChanStormstout/Pocs/blob/master/ImageMagick_POC/id%3A000000%2Csig%3A06%2Csrc%3A000001%2Ctime%3A4391%2Cexecs%3A1774%2Cop%3Ahavoc%2Crep%3A16



### Images

_No response_
Assertion failed in function: WriteBlob
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : Assertion failed in function: WriteBlob
Issue date:

--- start body ---
### ImageMagick version

ImageMagick 7.1.1-12 (Beta) Q16-HDRI x86_64

### Operating system

Linux

### Operating system, version and so on

Ubuntu 20.04.6 LTS

### Description

In the process of fuzzing ImageMagick via AFL++,an assertion failure was found in function WriteBlob in MagickCore/blob.c , which may allow attackers to cause a crash or denial of service via a designed crafted file.

```
#./magick $FILE ./output/
magick: MagickCore/blob.c:5719: ssize_t WriteBlob(Image *, const size_t, const void *): Assertion `image->blob->type != UndefinedStream' failed.
Aborted (core dumped)
```

### Steps to Reproduce

`./magick $FILE ./output/`
## Poc
https://github.com/ChanStormstout/Pocs/blob/master/ImageMagick_POC/id%3A000000%2Csig%3A06%2Csrc%3A000001%2Ctime%3A4391%2Cexecs%3A1774%2Cop%3Ahavoc%2Crep%3A16



### Images

_No response_
--- end body ---
