Commit 63aa5418 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent c2051d33
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment