### ImageMagick version

7.1.1-28

### Operating system

Linux

### Operating system, version and so on

Ubuntu Focal 20.04

### Description

Hi,

I'm upgrading ImageMagick in our dockerfiles from version 7.1.0-50 to 7.1.1-28, you can find a minimized version of the Dockerfile & a sample .orf file here: [files.zip](https://github.com/ImageMagick/ImageMagick/files/14280239/files.zip)

To process RAW files, we overwrite the `dng:decode` delegate so it uses darktable instead of ufraw-batch. This works fine in `7.1.0-50` but gets stuck in an infinite loop into a segmentation fault in `7.1.1-28`. After doing some testing with different IM versions, it seems to break as of `7.1.1-7`, other than ImageMagick version we are not changing anything in the Dockerfile.

For example:

```
magick identify /tmp/file.ORF
[export_job] exported to `/tmp/magick-t5skaEZgQHa2m-d6lU8-r0B0n1aNYIz4.ppm'
[exiv2] /tmp/magick--sXUI5Dv9zWeULTYYtEhnCHOToikvC83.ppm: /tmp/magick--sXUI5Dv9zWeULTYYtEhnCHOToikvC83.ppm: The file contains data of an unknown image type
[exiv2] /tmp/magick--sXUI5Dv9zWeULTYYtEhnCHOToikvC83.ppm: /tmp/magick--sXUI5Dv9zWeULTYYtEhnCHOToikvC83.ppm: The file contains data of an unknown image type
[export_job] exported to `/tmp/magick-H6jwJ73asO04e6RC4kfiNOIjzZAMYIg7.ppm'
[exiv2] /tmp/magick-PFTGwUPVPot_HGS5uAH2M4xFA53GmVq7.ppm: /tmp/magick-PFTGwUPVPot_HGS5uAH2M4xFA53GmVq7.ppm: The file contains data of an unknown image type
[exiv2] /tmp/magick-PFTGwUPVPot_HGS5uAH2M4xFA53GmVq7.ppm: /tmp/magick-PFTGwUPVPot_HGS5uAH2M4xFA53GmVq7.ppm: The file contains data of an unknown image type
...
[export_job] exported to `/tmp/magick-HHf66RlmioxPq9NA6qrxjAY_uHEzRpS5.ppm'
[exiv2] /tmp/magick-3WKMT22zYi5kvV77lpxoU1-4_04AX3s7.ppm: /tmp/magick-3WKMT22zYi5kvV77lpxoU1-4_04AX3s7.ppm: The file contains data of an unknown image type
[exiv2] /tmp/magick-3WKMT22zYi5kvV77lpxoU1-4_04AX3s7.ppm: /tmp/magick-3WKMT22zYi5kvV77lpxoU1-4_04AX3s7.ppm: The file contains data of an unknown image type
segmentation fault
```

It seems to just create .ppm files until it no longer can:
![image](https://github.com/ImageMagick/ImageMagick/assets/67702686/1d497826-0b71-4d67-93eb-0a27ecf808f3)



### Steps to Reproduce

1. Extract & download the attached files
2. Run `docker compose build` from the extracted folder
3. Run `docker compose up` from the extracted folder
4. Run `docker cp <./sample.ORF> <container_name>:/tmp/sample.ORF`
5. Run `docker exec -it <container_name> sh`
6. Run `magick identify /tmp/sample.ORF`

### Images

_No response_
Infinite loop dng:decode delegate for RAW files
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : Infinite loop dng:decode delegate for RAW files
Issue date:

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

7.1.1-28

### Operating system

Linux

### Operating system, version and so on

Ubuntu Focal 20.04

### Description

Hi,

I'm upgrading ImageMagick in our dockerfiles from version 7.1.0-50 to 7.1.1-28, you can find a minimized version of the Dockerfile & a sample .orf file here: [files.zip](https://github.com/ImageMagick/ImageMagick/files/14280239/files.zip)

To process RAW files, we overwrite the `dng:decode` delegate so it uses darktable instead of ufraw-batch. This works fine in `7.1.0-50` but gets stuck in an infinite loop into a segmentation fault in `7.1.1-28`. After doing some testing with different IM versions, it seems to break as of `7.1.1-7`, other than ImageMagick version we are not changing anything in the Dockerfile.

For example:

```
magick identify /tmp/file.ORF
[export_job] exported to `/tmp/magick-t5skaEZgQHa2m-d6lU8-r0B0n1aNYIz4.ppm'
[exiv2] /tmp/magick--sXUI5Dv9zWeULTYYtEhnCHOToikvC83.ppm: /tmp/magick--sXUI5Dv9zWeULTYYtEhnCHOToikvC83.ppm: The file contains data of an unknown image type
[exiv2] /tmp/magick--sXUI5Dv9zWeULTYYtEhnCHOToikvC83.ppm: /tmp/magick--sXUI5Dv9zWeULTYYtEhnCHOToikvC83.ppm: The file contains data of an unknown image type
[export_job] exported to `/tmp/magick-H6jwJ73asO04e6RC4kfiNOIjzZAMYIg7.ppm'
[exiv2] /tmp/magick-PFTGwUPVPot_HGS5uAH2M4xFA53GmVq7.ppm: /tmp/magick-PFTGwUPVPot_HGS5uAH2M4xFA53GmVq7.ppm: The file contains data of an unknown image type
[exiv2] /tmp/magick-PFTGwUPVPot_HGS5uAH2M4xFA53GmVq7.ppm: /tmp/magick-PFTGwUPVPot_HGS5uAH2M4xFA53GmVq7.ppm: The file contains data of an unknown image type
...
[export_job] exported to `/tmp/magick-HHf66RlmioxPq9NA6qrxjAY_uHEzRpS5.ppm'
[exiv2] /tmp/magick-3WKMT22zYi5kvV77lpxoU1-4_04AX3s7.ppm: /tmp/magick-3WKMT22zYi5kvV77lpxoU1-4_04AX3s7.ppm: The file contains data of an unknown image type
[exiv2] /tmp/magick-3WKMT22zYi5kvV77lpxoU1-4_04AX3s7.ppm: /tmp/magick-3WKMT22zYi5kvV77lpxoU1-4_04AX3s7.ppm: The file contains data of an unknown image type
segmentation fault
```

It seems to just create .ppm files until it no longer can:
![image](https://github.com/ImageMagick/ImageMagick/assets/67702686/1d497826-0b71-4d67-93eb-0a27ecf808f3)



### Steps to Reproduce

1. Extract & download the attached files
2. Run `docker compose build` from the extracted folder
3. Run `docker compose up` from the extracted folder
4. Run `docker cp <./sample.ORF> <container_name>:/tmp/sample.ORF`
5. Run `docker exec -it <container_name> sh`
6. Run `magick identify /tmp/sample.ORF`

### Images

_No response_
--- end body ---
