Module: wine Branch: master Commit: bd4ead0fec36a6901df0afa15743e4806c93fe68 URL: http://source.winehq.org/git/wine.git/?a=commit;h=bd4ead0fec36a6901df0afa157...
Author: Bruno Jesus 00cpxxx@gmail.com Date: Wed Oct 21 13:30:48 2015 +0800
msvfw32: Ask the driver about how much data is required for lpbiOut.
Signed-off-by: Bruno Jesus 00cpxxx@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/msvfw32/msvideo_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/msvfw32/msvideo_main.c b/dlls/msvfw32/msvideo_main.c index db71014..717bcf9 100644 --- a/dlls/msvfw32/msvideo_main.c +++ b/dlls/msvfw32/msvideo_main.c @@ -1458,7 +1458,13 @@ BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn)
if (!pc->lpbiOut) { - pc->lpbiOut = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BITMAPINFO)); + /* Ask compressor for needed header size */ + int size = ICSendMessage(pc->hic, ICM_COMPRESS_GET_FORMAT, + (DWORD_PTR)pc->lpbiIn, 0); + if (size <= 0) + goto error; + + pc->lpbiOut = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); if (!pc->lpbiOut) goto error; /* Flag to show that we allocated lpbiOut for proper cleanup */