Commit 2752c3bc authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

ole32: Don't fail if the file ends during a big block.

Apparently, it's valid for the last block in a file to be incomplete.
parent 053be78e
......@@ -3875,13 +3875,20 @@ static BOOL StorageImpl_ReadBigBlock(
void* buffer)
{
ULARGE_INTEGER ulOffset;
DWORD read;
DWORD read=0;
ulOffset.u.HighPart = 0;
ulOffset.u.LowPart = StorageImpl_GetBigBlockOffset(This, blockIndex);
StorageImpl_ReadAt(This, ulOffset, buffer, This->bigBlockSize, &read);
return (read == This->bigBlockSize);
if (read && read < This->bigBlockSize)
{
/* File ends during this block; fill the rest with 0's. */
memset((LPBYTE)buffer+read, 0, This->bigBlockSize-read);
}
return (read != 0);
}
static BOOL StorageImpl_ReadDWordFromBigBlock(
......
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