if ( depth > 8 ) return (PixmapPtr) NULL ;
if ((depth > 8) || (width > MAXSHORT) || (height > MAXSHORT)) return NullPixmap;
xf4bppCreatePixmap( pScreen, width, height, depth )    ScreenPtr	pScreen ;    int		width ;    int		height ;    int		depth ;{    register PixmapPtr pPixmap  = (PixmapPtr)NULL;    int size ;        TRACE(("xf4bppCreatePixmap(pScreen=0x%x, width=%d, height=%d, depth=%d)\n", pScreen, width, height, depth)) ;    if ( depth > 8 )	return (PixmapPtr) NULL ;    size = PixmapBytePad(width, depth);    pPixmap = AllocatePixmap (pScreen, (height * size));        if ( !pPixmap )	return (PixmapPtr) NULL ;    pPixmap->drawable.type = DRAWABLE_PIXMAP ;    pPixmap->drawable.class = 0 ;    pPixmap->drawable.pScreen = pScreen ;    pPixmap->drawable.depth = depth ;    pPixmap->drawable.id = 0 ;    pPixmap->drawable.bitsPerPixel = ( depth == 1 ) ? 1 : 8 ;    pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER ;    pPixmap->drawable.x = 0 ;    pPixmap->drawable.y = 0 ;    pPixmap->drawable.width = width ;    pPixmap->drawable.height = height ;    pPixmap->devKind = size;    pPixmap->refcnt = 1 ;    size = height * pPixmap->devKind ;#ifdef PIXPRIV    pPixmap->devPrivate.ptr = (pointer) (((CARD8*)pPixmap)					 + pScreen->totalPixmapSize);#else    pPixmap->devPrivate.ptr = (pointer) (pPixmap + 1);#endif    bzero( (char *) pPixmap->devPrivate.ptr, size ) ;    return pPixmap ;}