Commit 210b5467 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

We don't support GetDIBits with BI_RLE4/8, so for now return an

uncompressed bitmap if the bits buffer is large enough.
parent fddf5ce1
...@@ -72,6 +72,7 @@ typedef struct ...@@ -72,6 +72,7 @@ typedef struct
DWORD bMask; DWORD bMask;
BOOL useShm; BOOL useShm;
int dibpitch; int dibpitch;
DWORD sizeImage;
} X11DRV_DIB_IMAGEBITS_DESCR; } X11DRV_DIB_IMAGEBITS_DESCR;
...@@ -3516,24 +3517,27 @@ static int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr ) ...@@ -3516,24 +3517,27 @@ static int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
break; break;
case 4: case 4:
if (descr->compression) if (descr->compression) {
FIXME("Compression not yet supported!\n"); FIXME("Compression not yet supported!\n");
else if(descr->sizeImage < X11DRV_DIB_GetDIBWidthBytes( descr->infoWidth, 4 ) * abs(descr->lines))
X11DRV_DIB_GetImageBits_4( descr->lines,(LPVOID)descr->bits, break;
descr->infoWidth, descr->width, }
descr->colorMap, descr->palentry, X11DRV_DIB_GetImageBits_4( descr->lines,(LPVOID)descr->bits,
bmpImage, descr->dibpitch ); descr->infoWidth, descr->width,
break; descr->colorMap, descr->palentry,
bmpImage, descr->dibpitch );
break;
case 8: case 8:
if (descr->compression) if (descr->compression) {
FIXME("Compression not yet supported!\n"); FIXME("Compression not yet supported!\n");
else if(descr->sizeImage < X11DRV_DIB_GetDIBWidthBytes( descr->infoWidth, 8 ) * abs(descr->lines))
X11DRV_DIB_GetImageBits_8( descr->lines, (LPVOID)descr->bits, break;
descr->infoWidth, descr->width, }
descr->colorMap, descr->palentry, X11DRV_DIB_GetImageBits_8( descr->lines, (LPVOID)descr->bits,
bmpImage, descr->dibpitch ); descr->infoWidth, descr->width,
break; descr->colorMap, descr->palentry,
bmpImage, descr->dibpitch );
break;
case 15: case 15:
case 16: case 16:
X11DRV_DIB_GetImageBits_16( descr->lines, (LPVOID)descr->bits, X11DRV_DIB_GetImageBits_16( descr->lines, (LPVOID)descr->bits,
...@@ -3875,6 +3879,7 @@ INT X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan, ...@@ -3875,6 +3879,7 @@ INT X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan,
descr.xDest = 0; descr.xDest = 0;
descr.yDest = 0; descr.yDest = 0;
descr.xSrc = 0; descr.xSrc = 0;
descr.sizeImage = info->bmiHeader.biSizeImage;
if (descr.lines > 0) if (descr.lines > 0)
{ {
...@@ -4001,6 +4006,8 @@ static void X11DRV_DIB_DoCopyDIBSection(BITMAPOBJ *bmp, BOOL toDIB, ...@@ -4001,6 +4006,8 @@ static void X11DRV_DIB_DoCopyDIBSection(BITMAPOBJ *bmp, BOOL toDIB,
descr.yDest = yDest; descr.yDest = yDest;
descr.width = width; descr.width = width;
descr.height = height; descr.height = height;
descr.sizeImage = 0;
#ifdef HAVE_LIBXXSHM #ifdef HAVE_LIBXXSHM
descr.useShm = (dib->shminfo.shmid != -1); descr.useShm = (dib->shminfo.shmid != -1);
#else #else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment