### ImageMagick version

git 2b4275854

### Operating system

Linux

### Operating system, version and so on

`Linux arch 6.4.11-arch2-1 #1 SMP PREEMPT_DYNAMIC Sat, 19 Aug 2023 15:38:34 +0000 x86_64 GNU/Linux`

### Description

Run the following command to eat 100% of memory:
```
identify -format '%[EXIF:Orientation]\n' --  file.djvu
```

Related: https://github.com/ranger/ranger/issues/1815

### Steps to Reproduce

Here's the Dockerfile:
```Dockerfile
FROM archlinux:base-devel

RUN pacman -Syu --noconfirm

RUN pacman -S --noconfirm djvulibre

RUN mkdir /magick
WORKDIR /magick
COPY . .

RUN ./configure
RUN make install

ADD https://filesamples.com/samples/document/djvu/sample2.djvu /test/
```


```sh
$ git clone https://github.com/ImageMagick/ImageMagick
$ cd ImageMagick
$ git checkout 2b42758
# copy above docker file, save as Dockerfile. 
$ docker build -t repro6584 .
$ docker run -it repro6584
# in the shell insider docker:

# djvulibre works with no problem
$ ddjvu -format=tiff -quality=90 -page=1 -size=1000x1000 - /tmp/a < /test/sample2.djvu

# this will consume all memory
$ identify -format '%[EXIF:Orientation]\n' --  /test/sample2.djvu
```
Consumes 100% of RAM when trying to identify a djvu file
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : Consumes 100% of RAM when trying to identify a djvu file
Issue date:

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

git 2b4275854

### Operating system

Linux

### Operating system, version and so on

`Linux arch 6.4.11-arch2-1 #1 SMP PREEMPT_DYNAMIC Sat, 19 Aug 2023 15:38:34 +0000 x86_64 GNU/Linux`

### Description

Run the following command to eat 100% of memory:
```
identify -format '%[EXIF:Orientation]\n' --  file.djvu
```

Related: https://github.com/ranger/ranger/issues/1815

### Steps to Reproduce

Here's the Dockerfile:
```Dockerfile
FROM archlinux:base-devel

RUN pacman -Syu --noconfirm

RUN pacman -S --noconfirm djvulibre

RUN mkdir /magick
WORKDIR /magick
COPY . .

RUN ./configure
RUN make install

ADD https://filesamples.com/samples/document/djvu/sample2.djvu /test/
```


```sh
$ git clone https://github.com/ImageMagick/ImageMagick
$ cd ImageMagick
$ git checkout 2b42758
# copy above docker file, save as Dockerfile. 
$ docker build -t repro6584 .
$ docker run -it repro6584
# in the shell insider docker:

# djvulibre works with no problem
$ ddjvu -format=tiff -quality=90 -page=1 -size=1000x1000 - /tmp/a < /test/sample2.djvu

# this will consume all memory
$ identify -format '%[EXIF:Orientation]\n' --  /test/sample2.djvu
```
--- end body ---
