In the following two commits I added a hardcoded AVIF_MAX_IMAGE_SIZE:
0a8e724
2fb6361
Ideally the maximum image size should be a configurable decoder setting. We can add a maxImageSize decoder setting to the avifDecoder struct.
We will need to validate the maxImageSize value. Also, to support large maxImageSize values, some arithmetic operations involving the image width, height, or row bytes that currently use the int or unsigned int type will need to use the size_t type instead. We also need to handle a 32-bit size_t correctly.