msvfw32: Only update output parameters when the compress operation works.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cc9e70a80a
commit
3a7dfcd28f
@ -1375,6 +1375,11 @@ LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits, BOOL
|
||||
icComp->lpPrev = pc->lpBitsPrev;
|
||||
ret = ICSendMessage(pc->hic, ICM_COMPRESS, (DWORD_PTR)icComp, sizeof(*icComp));
|
||||
|
||||
TRACE(" -- 0x%08x\n", ret);
|
||||
if (ret == ICERR_OK)
|
||||
{
|
||||
LPVOID oldprev, oldout;
|
||||
|
||||
if (icComp->dwFlags & AVIIF_KEYFRAME)
|
||||
{
|
||||
pc->lKeyCount = 1;
|
||||
@ -1385,17 +1390,14 @@ LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits, BOOL
|
||||
*pfKey = FALSE;
|
||||
|
||||
*plSize = icComp->lpbiOutput->biSizeImage;
|
||||
TRACE(" -- 0x%08x\n", ret);
|
||||
if (ret == ICERR_OK)
|
||||
{
|
||||
LPVOID oldprev, oldout;
|
||||
|
||||
/* We shift Prev and Out, so we don't have to allocate and release memory */
|
||||
oldprev = pc->lpBitsPrev;
|
||||
oldout = pc->lpBitsOut;
|
||||
pc->lpBitsPrev = oldout;
|
||||
pc->lpBitsOut = oldprev;
|
||||
|
||||
TRACE("returning: %p\n", icComp->lpOutput);
|
||||
TRACE("returning: %p, compressed frame size %u\n", icComp->lpOutput, *plSize);
|
||||
return icComp->lpOutput;
|
||||
}
|
||||
return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user