avifil32: Only modify the stream info after a succesful allocation in AVIFILE_AddFrame().

This commit is contained in:
Henri Verbeet 2010-01-05 21:29:01 +01:00 committed by Alexandre Julliard
parent c2051d33d6
commit 63aa5418c1
1 changed files with 3 additions and 4 deletions

View File

@ -1381,10 +1381,8 @@ static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size, DW
ERR(": found palette change in non-video stream!\n");
return AVIERR_BADFORMAT;
}
This->sInfo.dwFlags |= AVISTREAMINFO_FORMATCHANGES;
This->sInfo.dwFormatChangeCount++;
if (This->idxFmtChanges == NULL || This->nIdxFmtChanges < This->sInfo.dwFormatChangeCount) {
if (This->idxFmtChanges == NULL || This->nIdxFmtChanges <= This->sInfo.dwFormatChangeCount) {
This->nIdxFmtChanges += 16;
if (This->idxFmtChanges == NULL)
This->idxFmtChanges =
@ -1397,7 +1395,8 @@ static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size, DW
return AVIERR_MEMORY;
}
n = This->sInfo.dwFormatChangeCount;
This->sInfo.dwFlags |= AVISTREAMINFO_FORMATCHANGES;
n = ++This->sInfo.dwFormatChangeCount;
This->idxFmtChanges[n].ckid = This->lLastFrame;
This->idxFmtChanges[n].dwFlags = 0;
This->idxFmtChanges[n].dwChunkOffset = offset;