Bruno Jesus : msvfw32: Ask the driver about how much data is required for lpbiOut.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Oct 21 10:39:58 CDT 2015
Module: wine
Branch: master
Commit: bd4ead0fec36a6901df0afa15743e4806c93fe68
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bd4ead0fec36a6901df0afa15743e4806c93fe68
Author: Bruno Jesus <00cpxxx at 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 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at 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 */
More information about the wine-cvs
mailing list