shader: Add more sanity checks regarding ranges
Ensure that last is after first to avoid overallocation. Always verify that the allocation succeeded before dereferencing a pointer.
Ensure that last is after first to avoid overallocation. Always verify that the allocation succeeded before dereferencing a pointer.