diff --git a/src/util/format/u_format.h b/src/util/format/u_format.h index 818c073025f..95976ec14a6 100644 --- a/src/util/format/u_format.h +++ b/src/util/format/u_format.h @@ -1361,6 +1361,8 @@ static inline unsigned util_format_get_nr_components(enum pipe_format format) { const struct util_format_description *desc = util_format_description(format); + assert(desc->nr_channels <= 4); + return desc->nr_channels; }