Hello,

I am using libheif to encode large images via x265 encoder. I am interested in testing the smallest CTU size (16).
I receive the `Invalid Image size` error. For squared images with size HxH, this happens for H>1488.

For convenience, we can reproduce the error using `heif-enc` on a 2048x2048 test image:
```
 heif-enc -p x265:ctu=16  man4.jpg man4_ctu16.heic
```
```
Could not encode HEIF/AVIF file: Encoder plugin generated an error: Invalid image size
```

It works fine with a smaller image, e.g. 1024x1024, or with higher `ctu`:
```
 heif-enc -p x265:ctu=16  man1.jpg man1_ctu16.heic
 heif-enc -p x265:ctu=32  man4.jpg man4_ctu32.heic
 heif-enc -p x265:ctu=64  man4.jpg man4_ctu64.heic
```

It seems to be independent on the image content, at least with the samples I have tried.

I am using libheif v1.17.6 and x265 v3.5.

---
[test_images.zip](https://github.com/strukturag/libheif/files/14960588/test_images.zip)

Error in encoding big images with CTU size 16
This is a GitHub Issue
repo:libheif
owner:strukturag
Title : Error in encoding big images with CTU size 16
Issue date:

--- start body ---
Hello,

I am using libheif to encode large images via x265 encoder. I am interested in testing the smallest CTU size (16).
I receive the `Invalid Image size` error. For squared images with size HxH, this happens for H>1488.

For convenience, we can reproduce the error using `heif-enc` on a 2048x2048 test image:
```
 heif-enc -p x265:ctu=16  man4.jpg man4_ctu16.heic
```
```
Could not encode HEIF/AVIF file: Encoder plugin generated an error: Invalid image size
```

It works fine with a smaller image, e.g. 1024x1024, or with higher `ctu`:
```
 heif-enc -p x265:ctu=16  man1.jpg man1_ctu16.heic
 heif-enc -p x265:ctu=32  man4.jpg man4_ctu32.heic
 heif-enc -p x265:ctu=64  man4.jpg man4_ctu64.heic
```

It seems to be independent on the image content, at least with the samples I have tried.

I am using libheif v1.17.6 and x265 v3.5.

---
[test_images.zip](https://github.com/strukturag/libheif/files/14960588/test_images.zip)

--- end body ---
