From: Torge Matthies tmatthies@codeweavers.com
ICM_DECOMPRESS_GET_FORMAT does not work well with the BITMAPINFOHEADER from MS-CRAM, because a biBitCount of 24 (or anything above 8) indicates RGB555 encoding, which actually means the bit count is 16 bpp, but the decoder rejects any format that doesn't have biBitCount of exactly 8 or 16.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54024 Signed-off-by: Torge Matthies tmatthies@codeweavers.com --- dlls/comctl32/animate.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-)
diff --git a/dlls/comctl32/animate.c b/dlls/comctl32/animate.c index f4d848fef91..3be1e227a65 100644 --- a/dlls/comctl32/animate.c +++ b/dlls/comctl32/animate.c @@ -41,8 +41,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(animate);
static struct { HMODULE hModule; - HIC (WINAPI *fnICOpen)(DWORD, DWORD, UINT); LRESULT (WINAPI *fnICClose)(HIC); + HIC (WINAPI *fnICGetDisplayFormat)(HIC,LPBITMAPINFOHEADER,LPBITMAPINFOHEADER,int,int,int); LRESULT (WINAPI *fnICSendMessage)(HIC, UINT, DWORD_PTR, DWORD_PTR); DWORD (WINAPIV *fnICDecompress)(HIC,DWORD,LPBITMAPINFOHEADER,LPVOID,LPBITMAPINFOHEADER,LPVOID); } fnIC; @@ -645,8 +645,6 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr) { - DWORD outSize; - /* check uncompressed AVI */ if ((infoPtr->ash.fccHandler == mmioFOURCC('D', 'I', 'B', ' ')) || (infoPtr->ash.fccHandler == mmioFOURCC('R', 'L', 'E', ' ')) || @@ -656,23 +654,12 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr) return TRUE; }
- /* try to get a decompressor for that type */ - infoPtr->hic = fnIC.fnICOpen(ICTYPE_VIDEO, infoPtr->ash.fccHandler, ICMODE_DECOMPRESS); - if (!infoPtr->hic) { - WARN("Can't load codec for the file\n"); - return FALSE; - } - - outSize = fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, - (DWORD_PTR)infoPtr->inbih, 0L); - - if (!(infoPtr->outbih = Alloc(outSize))) + if (!(infoPtr->outbih = Alloc(FIELD_OFFSET(BITMAPINFO, bmiColors[256])))) return FALSE;
- if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, - (DWORD_PTR)infoPtr->inbih, (DWORD_PTR)infoPtr->outbih) != ICERR_OK) - { - WARN("Can't get output BIH\n"); + infoPtr->hic = fnIC.fnICGetDisplayFormat(NULL, infoPtr->inbih, infoPtr->outbih, 24, 0, 0); + if (!infoPtr->hic) { + WARN("Can't load codec for the file\n"); return FALSE; }
@@ -799,8 +786,8 @@ static BOOL ANIMATE_Create(HWND hWnd, const CREATESTRUCTW *lpcs) fnIC.hModule = LoadLibraryW(L"msvfw32.dll"); if (!fnIC.hModule) return FALSE;
- fnIC.fnICOpen = (void*)GetProcAddress(fnIC.hModule, "ICOpen"); fnIC.fnICClose = (void*)GetProcAddress(fnIC.hModule, "ICClose"); + fnIC.fnICGetDisplayFormat = (void*)GetProcAddress(fnIC.hModule, "ICGetDisplayFormat"); fnIC.fnICSendMessage = (void*)GetProcAddress(fnIC.hModule, "ICSendMessage"); fnIC.fnICDecompress = (void*)GetProcAddress(fnIC.hModule, "ICDecompress"); }