X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EdkUnixPkg%2FSec%2FUgaX11.c;h=b5719cfd596adeac8a635427bc5db4513a712ec5;hp=5fbdeae1e2efe1e653992dabf152f174a9571978;hb=86e6bb786f6f23201a2041901362e08b80681930;hpb=f8d88c1ffc815c4ec89e3910b142ca5ad9376ac5 diff --git a/EdkUnixPkg/Sec/UgaX11.c b/EdkUnixPkg/Sec/UgaX11.c index 5fbdeae1e2..b5719cfd59 100644 --- a/EdkUnixPkg/Sec/UgaX11.c +++ b/EdkUnixPkg/Sec/UgaX11.c @@ -113,8 +113,8 @@ TryCreateShmImage(UGA_IO_PRIVATE *drv) /* Can this fail ? */ shmctl (drv->xshm_info.shmid, IPC_RMID, NULL); - drv->xshm_info.shmaddr = drv->image_data; - drv->image->data = drv->image_data; + drv->xshm_info.shmaddr = (char*)drv->image_data; + drv->image->data = (char*)drv->image_data; if (!XShmAttach (drv->display, &drv->xshm_info)) { @@ -189,7 +189,7 @@ UgaSize(EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, UINT32 Width, UINT32 Height) drv->image_data = malloc((drv->width * drv->height) << drv->pixel_shift); drv->image = XCreateImage (drv->display, drv->visual, drv->depth, - ZPixmap, 0, drv->image_data, + ZPixmap, 0, (char *)drv->image_data, drv->width, drv->height, 8 << drv->pixel_shift, 0); } @@ -328,6 +328,7 @@ UgaColorToPixel (UGA_IO_PRIVATE *drv, unsigned long val) { EFI_UGA_PIXEL res; + memset (&res, 0, sizeof (EFI_UGA_PIXEL)); /* FIXME: should round instead of truncate. */ res.Red = (val >> drv->r.shift) << drv->r.csize; res.Green = (val >> drv->g.shift) << drv->g.csize;