[PATCH 3/5] avifil32: Properly check the required buffer size in AVIFILE_ReadBlock().

Henri Verbeet hverbeet at codeweavers.com
Mon Jan 4 14:33:12 CST 2010


---
 dlls/avifil32/avifile.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/avifil32/avifile.c b/dlls/avifil32/avifile.c
index 49e141f..2486611 100644
--- a/dlls/avifil32/avifile.c
+++ b/dlls/avifil32/avifile.c
@@ -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)
-- 
1.6.4.4




More information about the wine-patches mailing list