Module: wine Branch: master Commit: 2a81c1ada70d97d574a48f34347d4818eae1b2b5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=2a81c1ada70d97d574a48f3434...
Author: Dmitry Timoshkov dmitry@codeweavers.com Date: Wed Jun 13 19:18:55 2007 +0900
gdi32: Make BITMAPINFOHEADER biSize check match what other parts of code do.
---
dlls/gdi32/dib.c | 41 +++++++++-------------------------------- 1 files changed, 9 insertions(+), 32 deletions(-)
diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 86e1308..2a98efb 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -149,22 +149,11 @@ int DIB_BitmapInfoSize( const BITMAPINFO * info, WORD coloruse ) * DIB_GetBitmapInfo * * Get the info from a bitmap header. - * Return 1 for INFOHEADER, 0 for COREHEADER, - * 4 for V4HEADER, 5 for V5HEADER, -1 for error. + * Return 0 for COREHEADER, 1 for INFOHEADER, -1 for error. */ static int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, LONG *width, LONG *height, WORD *planes, WORD *bpp, DWORD *compr, DWORD *size ) { - if (header->biSize == sizeof(BITMAPINFOHEADER)) - { - *width = header->biWidth; - *height = header->biHeight; - *planes = header->biPlanes; - *bpp = header->biBitCount; - *compr = header->biCompression; - *size = header->biSizeImage; - return 1; - } if (header->biSize == sizeof(BITMAPCOREHEADER)) { const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)header; @@ -176,27 +165,15 @@ static int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, LONG *width, *size = 0; return 0; } - if (header->biSize == sizeof(BITMAPV4HEADER)) + if (header->biSize >= sizeof(BITMAPINFOHEADER)) /* assume BITMAPINFOHEADER */ { - const BITMAPV4HEADER *v4hdr = (const BITMAPV4HEADER *)header; - *width = v4hdr->bV4Width; - *height = v4hdr->bV4Height; - *planes = v4hdr->bV4Planes; - *bpp = v4hdr->bV4BitCount; - *compr = v4hdr->bV4V4Compression; - *size = v4hdr->bV4SizeImage; - return 4; - } - if (header->biSize == sizeof(BITMAPV5HEADER)) - { - const BITMAPV5HEADER *v5hdr = (const BITMAPV5HEADER *)header; - *width = v5hdr->bV5Width; - *height = v5hdr->bV5Height; - *planes = v5hdr->bV5Planes; - *bpp = v5hdr->bV5BitCount; - *compr = v5hdr->bV5Compression; - *size = v5hdr->bV5SizeImage; - return 5; + *width = header->biWidth; + *height = header->biHeight; + *planes = header->biPlanes; + *bpp = header->biBitCount; + *compr = header->biCompression; + *size = header->biSizeImage; + return 1; } ERR("(%d): unknown/wrong size for header\n", header->biSize ); return -1;