avifil32: Properly check the required buffer size in AVIFILE_ReadBlock().

This commit is contained in:
Henri Verbeet 2010-01-04 21:33:12 +01:00 committed by Alexandre Julliard
parent f5c8153edd
commit 4c36e12be6

View File

@ -2027,7 +2027,7 @@ static HRESULT AVIFILE_ReadBlock(IAVIStreamImpl *This, DWORD pos,
size += 2 * sizeof(DWORD);
/* check that buffer is big enough -- don't trust dwSuggestedBufferSize */
if (This->lpBuffer == NULL || size < This->cbBuffer) {
if (This->lpBuffer == NULL || This->cbBuffer < size) {
DWORD maxSize = max(size, This->sInfo.dwSuggestedBufferSize);
if (This->lpBuffer == NULL)