util/format: add missing null check in util_format_is_srgb()
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11137
Fixes: ff6cf60cb8 ("gallium/util: add util_format_is_srgb() helper")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29160>
This commit is contained in:
committed by
Marge Bot
parent
2f02af39b3
commit
8c22112a7d
@@ -554,6 +554,12 @@ static inline bool
|
||||
util_format_is_srgb(enum pipe_format format)
|
||||
{
|
||||
const struct util_format_description *desc = util_format_description(format);
|
||||
|
||||
assert(desc);
|
||||
if (!desc) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user