From e234587a48823bcb6687ccf32f29c744c8919e32 Mon Sep 17 00:00:00 2001 From: Roland Baer Date: Mon, 6 Aug 2007 16:56:08 +0300 Subject: [PATCH] Overrun in not found case fix --- src/radeon_exa_render.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c index 9251569..a4ec9c6 100644 --- a/src/radeon_exa_render.c +++ b/src/radeon_exa_render.c @@ -241,6 +241,9 @@ static Bool FUNC_NAME(R100TextureSetup)(PicturePtr pPict, PixmapPtr pPix, if (R100TexFormats[i].fmt == pPict->format) break; } + if (i ==( sizeof(R100TexFormats) / sizeof(R100TexFormats[0]))) + RADEON_FALLBACK(("Not found R100TexFormats[].fmt\n")); + txformat = R100TexFormats[i].card_fmt; if (RADEONPixmapIsColortiled(pPix)) txoffset |= RADEON_TXO_MACRO_TILE; @@ -502,6 +505,9 @@ static Bool FUNC_NAME(R200TextureSetup)(PicturePtr pPict, PixmapPtr pPix, if (R200TexFormats[i].fmt == pPict->format) break; } + if (i ==( sizeof(R200TexFormats) / sizeof(R200TexFormats[0]))) + RADEON_FALLBACK(("Not found R200TexFormats[].fmt\n")); + txformat = R200TexFormats[i].card_fmt; if (RADEONPixmapIsColortiled(pPix)) txoffset |= R200_TXO_MACRO_TILE; -- 1.5.2.3