mirror of
https://github.com/X11Libre/xf86-video-mach64.git
synced 2026-03-24 01:24:33 +00:00
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>
This commit is contained in:
@@ -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) |
|
||||
|
||||
Reference in New Issue
Block a user