summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-05-10 16:56:02 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-05-10 16:56:02 -0700
commitd9d787167795862909738892195fcdc751c413ed (patch)
tree02200f04d6732d30f79494ead17358171aa4cb5f
parent99db87ed49d7eca8de2ff1f7d53b580637ebb916 (diff)
Doublecheck pictFormat is a supported format
Fixes these warnings from parfait source checker: Error: Read buffer overflow at src/atimach64render.c:601 in function 'Mach64PrepareTexture' [Symbolic analysis] In array dereference of Mach64TexFormats[i] with index 'i' Array size is 6 elements (of 12 bytes each), index >= 0 and index <= 6 Error: Read buffer overflow at src/atimach64render.c:712 in function 'Mach64PrepareComposite' [Symbolic analysis] In array dereference of Mach64TexFormats[i] with index 'i' Array size is 6 elements (of 12 bytes each), index >= 0 and index <= 6 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r--src/atimach64render.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/atimach64render.c b/src/atimach64render.c
index dda3938..1e9485e 100644
--- a/src/atimach64render.c
+++ b/src/atimach64render.c
@@ -598,6 +598,9 @@ Mach64PrepareTexture(PicturePtr pPict, PixmapPtr pPix)
if (Mach64TexFormats[i].pictFormat == pPict->format)
break;
}
+ if (i == MACH64_NR_TEX_FORMATS)
+ MACH64_FALLBACK(("Unsupported picture format 0x%x\n",
+ (int)pPict->format));
texFormat = Mach64TexFormats[i].texFormat;
/* Prepare picture size */
@@ -709,6 +712,9 @@ Mach64PrepareComposite
if (Mach64TexFormats[i].pictFormat == pDstPicture->format)
break;
}
+ if (i == MACH64_NR_TEX_FORMATS)
+ MACH64_FALLBACK(("Unsupported picture format 0x%x\n",
+ (int)pPict->format));
dstFormat = Mach64TexFormats[i].dstFormat;
m3d->dp_pix_width = SetBits(dstFormat, DP_DST_PIX_WIDTH) |