From 74d2456491fbd96eb3fb99cf8dd3595b223c2065 Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Tue, 12 Sep 2017 23:38:45 +0300 Subject: gallium/{r600, radeonsi}: Fix segfault with color format (v2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102552 v2: Patch cleanup proposed by Nicolai Hähnle. * deleted changes in si_translate_texformat. Cc: Nicolai Hähnle Cc: Ilia Mirkin Signed-off-by: Marek Olšák --- src/gallium/auxiliary/util/u_format.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gallium/auxiliary') diff --git a/src/gallium/auxiliary/util/u_format.c b/src/gallium/auxiliary/util/u_format.c index 3d281905ce7..a6d42a428dc 100644 --- a/src/gallium/auxiliary/util/u_format.c +++ b/src/gallium/auxiliary/util/u_format.c @@ -238,6 +238,10 @@ util_format_is_subsampled_422(enum pipe_format format) boolean util_format_is_supported(enum pipe_format format, unsigned bind) { + if (format >= PIPE_FORMAT_COUNT) { + return FALSE; + } + if (util_format_is_s3tc(format) && !util_format_s3tc_enabled) { return FALSE; } -- cgit v1.2.3