61f94fff0d
1. Clamp bucket_index from both ends to avoid returning negative index. 2. Return NULL in case BO allocation/fetching failure to prevent invalid bo mapping. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6247 Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15748>