diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2013-11-25 09:09:31 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-11-25 10:04:49 +0000 |
commit | 318f100d7337955c099fecb86d206c406779fafe (patch) | |
tree | 294a5208b6102963e517be26c9dff7206abb9c05 /src/uxa/i965_render.c | |
parent | a110637ef2a37505ee68447cf66763af4cabfc00 (diff) |
uxa: Avoid relying on an assert and cleanup iterator
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Diffstat (limited to 'src/uxa/i965_render.c')
-rw-r--r-- | src/uxa/i965_render.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/uxa/i965_render.c b/src/uxa/i965_render.c index 404fc12a..74f57afc 100644 --- a/src/uxa/i965_render.c +++ b/src/uxa/i965_render.c @@ -1260,16 +1260,16 @@ static drm_intel_bo *gen4_create_cc_unit_state(intel_screen_private *intel) static uint32_t i965_get_card_format(PicturePtr picture) { - int i; + unsigned i; for (i = 0; i < sizeof(i965_tex_formats) / sizeof(i965_tex_formats[0]); - i++) { + i++) if (i965_tex_formats[i].fmt == picture->format) - break; - } + return i965_tex_formats[i].card_fmt; + assert(i != sizeof(i965_tex_formats) / sizeof(i965_tex_formats[0])); - return i965_tex_formats[i].card_fmt; + return 0; } static sampler_state_filter_t sampler_state_filter_from_picture(int filter) |