From 6b953ffcaca43db5c8571a723bd76ffe644044b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20G=C3=BCnnewig?= Date: Sat, 19 Oct 2002 00:11:32 +0000 Subject: [PATCH] Fixed very slow loading of index. --- dlls/avifil32/avifile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/avifil32/avifile.c b/dlls/avifil32/avifile.c index 989c2b81510..9300cb85e33 100644 --- a/dlls/avifil32/avifile.c +++ b/dlls/avifil32/avifile.c @@ -1348,7 +1348,7 @@ static HRESULT AVIFILE_AddFrame(IAVIStreamImpl *This, DWORD ckid, DWORD size, DW This->sInfo.dwSuggestedBufferSize = size; /* get memory for index */ - if (This->idxFrames == NULL || This->dwLastFrame + 1 < This->nIdxFrames) { + if (This->idxFrames == NULL || This->dwLastFrame + 1 >= This->nIdxFrames) { This->nIdxFrames += 512; This->idxFrames = GlobalReAllocPtr(This->idxFrames, This->nIdxFrames * sizeof(AVIINDEXENTRY), GHND); if (This->idxFrames == NULL) @@ -1812,7 +1812,7 @@ static HRESULT AVIFILE_LoadIndex(IAVIFileImpl *This, DWORD size, DWORD offset) if (pStream->sInfo.dwSampleSize != 0) { if (n > 0 && This->fInfo.dwFlags & AVIFILEINFO_ISINTERLEAVED) { - pStream->nIdxFrames = pStream->nIdxFrames; + pStream->nIdxFrames = This->ppStreams[0]->nIdxFrames; } else if (pStream->sInfo.dwSuggestedBufferSize) { pStream->nIdxFrames = pStream->sInfo.dwLength / pStream->sInfo.dwSuggestedBufferSize;