xf86-video-mach64: Branch 'master'

Alan Coopersmith alanc at kemper.freedesktop.org
Sun May 10 17:00:55 PDT 2009


 src/atimach64render.c |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit d9d787167795862909738892195fcdc751c413ed
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Sun May 10 16:56:02 2009 -0700

    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 at sun.com>

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) |


More information about the xorg-commit mailing list