diff --git a/dlls/iccvid/iccvid.c b/dlls/iccvid/iccvid.c index 67d31ab1fa3..b46523cbc21 100644 --- a/dlls/iccvid/iccvid.c +++ b/dlls/iccvid/iccvid.c @@ -783,20 +783,26 @@ LRESULT ICCVID_DecompressQuery( ICCVID_Info *info, LPBITMAPINFO in, LPBITMAPINFO LRESULT ICCVID_DecompressGetFormat( ICCVID_Info *info, LPBITMAPINFO in, LPBITMAPINFO out ) { + DWORD size; + TRACE("ICM_DECOMPRESS_GETFORMAT %p %p %p\n", info, in, out); if( (info==NULL) || (info->dwMagic!=ICCVID_MAGIC) ) return ICERR_BADPARAM; + size = in->bmiHeader.biSize; + if (in->bmiHeader.biBitCount <= 8) + size += in->bmiHeader.biClrUsed * sizeof(RGBQUAD); + if( out ) { - memcpy( out, in, sizeof (BITMAPINFO) ); + memcpy( out, in, size ); out->bmiHeader.biCompression = BI_RGB; out->bmiHeader.biSizeImage = in->bmiHeader.biHeight * in->bmiHeader.biWidth *4; + return ICERR_OK; } - - return sizeof (BITMAPINFO); + return size; } LRESULT ICCVID_DecompressBegin( ICCVID_Info *info, LPBITMAPINFO in, LPBITMAPINFO out ) diff --git a/dlls/msvidc32/msvideo1.c b/dlls/msvidc32/msvideo1.c index d82d622c18c..16d487f8533 100644 --- a/dlls/msvidc32/msvideo1.c +++ b/dlls/msvidc32/msvideo1.c @@ -346,21 +346,27 @@ CRAM_DecompressQuery( Msvideo1Context *info, LPBITMAPINFO in, LPBITMAPINFO out ) static LRESULT CRAM_DecompressGetFormat( Msvideo1Context *info, LPBITMAPINFO in, LPBITMAPINFO out ) { + DWORD size; + TRACE("ICM_DECOMPRESS_GETFORMAT %p %p %p\n", info, in, out); if( (info==NULL) || (info->dwMagic!=CRAM_MAGIC) ) return ICERR_BADPARAM; + size = in->bmiHeader.biSize; + if (in->bmiHeader.biBitCount <= 8) + size += in->bmiHeader.biClrUsed * sizeof(RGBQUAD); + if( out ) { - memcpy( out, in, sizeof (BITMAPINFO) ); + memcpy( out, in, size ); out->bmiHeader.biCompression = BI_RGB; out->bmiHeader.biSizeImage = in->bmiHeader.biHeight * in->bmiHeader.biWidth *4; - out->bmiHeader.biBitCount = in->bmiHeader.biBitCount; + return ICERR_OK; } - return sizeof (BITMAPINFO); + return size; } LRESULT CRAM_DecompressBegin( Msvideo1Context *info, LPBITMAPINFO in, LPBITMAPINFO out ) diff --git a/dlls/msvideo/msrle32/msrle32.c b/dlls/msvideo/msrle32/msrle32.c index db5c72fc729..423a5a397b8 100644 --- a/dlls/msvideo/msrle32/msrle32.c +++ b/dlls/msvideo/msrle32/msrle32.c @@ -1551,7 +1551,7 @@ static LRESULT CompressEnd(CodecInfo *pi) static LRESULT DecompressGetFormat(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut) { - int size; + DWORD size; TRACE("(%p,%p,%p)\n",pi,lpbiIn,lpbiOut); @@ -1566,19 +1566,15 @@ static LRESULT DecompressGetFormat(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, size = lpbiIn->biSize; + if (lpbiIn->biBitCount <= 8) + size += lpbiIn->biClrUsed * sizeof(RGBQUAD); + if (lpbiOut != NULL) { memcpy(lpbiOut, lpbiIn, size); - lpbiOut->biBitCount = 32; lpbiOut->biCompression = BI_RGB; lpbiOut->biSizeImage = DIBWIDTHBYTES(*lpbiOut) * lpbiOut->biHeight; - lpbiOut->biClrImportant = 0; - if (lpbiOut->biBitCount <= 8 && lpbiOut->biClrUsed == 0) - lpbiOut->biClrUsed = 1 << lpbiOut->biBitCount; - else - lpbiOut->biClrUsed = 0; - - return size; + return ICERR_OK; } else return size; } diff --git a/dlls/msvideo/msvideo_main.c b/dlls/msvideo/msvideo_main.c index 24abdc0843e..ac5857e8c46 100644 --- a/dlls/msvideo/msvideo_main.c +++ b/dlls/msvideo/msvideo_main.c @@ -575,7 +575,8 @@ HIC VFWAPI ICGetDisplayFormat( { HIC tmphic = hic; - FIXME("(%p,%p,%p,%d,%d,%d),stub!\n",hic,lpbiIn,lpbiOut,depth,dx,dy); + TRACE("(%p,%p,%p,%d,%d,%d)!\n",hic,lpbiIn,lpbiOut,depth,dx,dy); + if (!tmphic) { tmphic=ICLocate(ICTYPE_VIDEO,0,lpbiIn,NULL,ICMODE_DECOMPRESS); if (!tmphic)