mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-11 07:20:30 +01:00
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:
parent
2f02af39b3
commit
8c22112a7d
1 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue