When 'really' large buffers are allocated the incorrect clamping function was used and the actual buffer allocated was smaller than expected. This was detected during investigation of #126863. Pull Request: https://projects.blender.org/blender/blender/pulls/126915