diff --git a/src/util/format/u_format.h b/src/util/format/u_format.h index adde3eb44e3..ccc2d6c0c96 100644 --- a/src/util/format/u_format.h +++ b/src/util/format/u_format.h @@ -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; }