Draft: core: make maximum plane count a constant and enforce it
This makes it clearer what specifically depends on the plane count, enabling adding a check where a too-high plane count would have led to heap corruption.
This makes it clearer what specifically depends on the plane count, enabling adding a check where a too-high plane count would have led to heap corruption.