Ensure canvas size remains within limits

This commit is contained in:
2026-01-12 17:31:38 +01:00
parent acc2bf4538
commit 8a76ab2fb9

View File

@@ -733,7 +733,9 @@ public class ChannelDirectoryService {
BAD_REQUEST,
"Canvas width out of range [0 to " + canvasMaxSizePixels + "]"
);
if (req.getHeight() == null || req.getHeight() <= 0) throw new ResponseStatusException(
if (
req.getHeight() == null || req.getHeight() <= 0 || req.getHeight() > canvasMaxSizePixels
) throw new ResponseStatusException(
BAD_REQUEST,
"Canvas height out of range [0 to " + canvasMaxSizePixels + "]"
);