ImageMagick 7.0.8-50 Q16 has a heap-based buffer over-read at MagickCore/threshold.c in AdaptiveThresholdImage because a height of zero is mishandled.
### Prerequisites

- [x] I have written a descriptive issue title
- [x] I have verified that I am using the latest version of ImageMagick
- [x] I have searched [open](https://github.com/ImageMagick/ImageMagick/issues) and [closed](https://github.com/ImageMagick/ImageMagick/issues?q=is%3Aissue+is%3Aclosed) issues to ensure it has not already been reported

### Description
<!-- A description of the bug or feature -->
There's a heap-buffer-overflow at MagickCore/threshold.c:328:11 in AdaptiveThresholdImage.

### Steps to Reproduce
<!-- List of steps, sample code, failing test or link to a project that reproduces the behavior.
     Make sure you place a stack trace inside a code (```) block to avoid linking unrelated issues -->
run_cmd:
`magick -seed 0 -dispose Background "(" magick:netscape -lat 514x0-41  ")" "(" magick:granite -charcoal 3 -level 0%,125,0.328  ")" -combine -print ""   tmp`

Here's ASAN log.
```
==22189==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x620000001090 at pc 0x7fd7e5dd4be2 bp 0x7ffd816c3a30 sp 0x7ffd816c3a28
READ of size 4 at 0x620000001090 thread T0
    #0 0x7fd7e5dd4be1 in AdaptiveThresholdImage MagickCore/threshold.c:328:11
    #1 0x7fd7e5386cb6 in CLISimpleOperatorImage MagickWand/operation.c:2571:21
    #2 0x7fd7e537bc78 in CLISimpleOperatorImages MagickWand/operation.c:3685:12
    #3 0x7fd7e53a1315 in CLIOption MagickWand/operation.c:5273:16
    #4 0x7fd7e51e2a99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #5 0x7fd7e51e3d0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #6 0x7fd7e522dba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #7 0x526f95 in MagickMain utilities/magick.c:149:10
    #8 0x5268e1 in main utilities/magick.c:180:10
    #9 0x7fd7dfca4b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #10 0x41b069 in _start (install/bin/magick+0x41b069)

Address 0x620000001090 is a wild pointer.
SUMMARY: AddressSanitizer: heap-buffer-overflow MagickCore/threshold.c:328:11 in AdaptiveThresholdImage
```

### System Configuration
<!-- Tell us about the environment where you are experiencing the bug -->

- ImageMagick version:
Version: ImageMagick 7.0.8-50 Q16 x86_64 2019-06-21 https://imagemagick.org

- Environment (Operating system, version and so on):
Description:	Ubuntu 18.04.1 LTS
Release:	18.04
Codename: bionic

- Additional information:
CC=clang-7 CXX=clang++-7 ./configure --disable-openmp
<!-- Thanks for reporting the issue to ImageMagick! -->

heap-buffer-overflow at MagickCore/threshold.c:328:11 in AdaptiveThresholdImage
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : heap-buffer-overflow at MagickCore/threshold.c:328:11 in AdaptiveThresholdImage
Issue date:

--- start body ---
### Prerequisites

- [x] I have written a descriptive issue title
- [x] I have verified that I am using the latest version of ImageMagick
- [x] I have searched [open](https://github.com/ImageMagick/ImageMagick/issues) and [closed](https://github.com/ImageMagick/ImageMagick/issues?q=is%3Aissue+is%3Aclosed) issues to ensure it has not already been reported

### Description
<!-- A description of the bug or feature -->
There's a heap-buffer-overflow at MagickCore/threshold.c:328:11 in AdaptiveThresholdImage.

### Steps to Reproduce
<!-- List of steps, sample code, failing test or link to a project that reproduces the behavior.
     Make sure you place a stack trace inside a code (```) block to avoid linking unrelated issues -->
run_cmd:
`magick -seed 0 -dispose Background "(" magick:netscape -lat 514x0-41  ")" "(" magick:granite -charcoal 3 -level 0%,125,0.328  ")" -combine -print ""   tmp`

Here's ASAN log.
```
==22189==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x620000001090 at pc 0x7fd7e5dd4be2 bp 0x7ffd816c3a30 sp 0x7ffd816c3a28
READ of size 4 at 0x620000001090 thread T0
    #0 0x7fd7e5dd4be1 in AdaptiveThresholdImage MagickCore/threshold.c:328:11
    #1 0x7fd7e5386cb6 in CLISimpleOperatorImage MagickWand/operation.c:2571:21
    #2 0x7fd7e537bc78 in CLISimpleOperatorImages MagickWand/operation.c:3685:12
    #3 0x7fd7e53a1315 in CLIOption MagickWand/operation.c:5273:16
    #4 0x7fd7e51e2a99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #5 0x7fd7e51e3d0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #6 0x7fd7e522dba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #7 0x526f95 in MagickMain utilities/magick.c:149:10
    #8 0x5268e1 in main utilities/magick.c:180:10
    #9 0x7fd7dfca4b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #10 0x41b069 in _start (install/bin/magick+0x41b069)

Address 0x620000001090 is a wild pointer.
SUMMARY: AddressSanitizer: heap-buffer-overflow MagickCore/threshold.c:328:11 in AdaptiveThresholdImage
```

### System Configuration
<!-- Tell us about the environment where you are experiencing the bug -->

- ImageMagick version:
Version: ImageMagick 7.0.8-50 Q16 x86_64 2019-06-21 https://imagemagick.org

- Environment (Operating system, version and so on):
Description:	Ubuntu 18.04.1 LTS
Release:	18.04
Codename: bionic

- Additional information:
CC=clang-7 CXX=clang++-7 ./configure --disable-openmp
<!-- Thanks for reporting the issue to ImageMagick! -->

--- end body ---

A heap-buffer-overflow vulnerability in the AdaptiveThresholdImage function of ImageMagick version 7.0.8-50 can lead to potential memory corruption and application crashes. This issue is triggered when specific command-line arguments are used, resulting in a read operation on an invalid memory address, as indicated by the AddressSanitizer log.