GetMetaFile checks both the version and the header size when it tries

to load a metafile.  Powerpoint XP depends on this.
This commit is contained in:
Huw Davies 2005-01-26 19:41:58 +00:00 committed by Alexandre Julliard
parent e8cafa5799
commit 82977c1441
1 changed files with 4 additions and 0 deletions

View File

@ -245,6 +245,10 @@ static METAHEADER *MF_ReadMetaFile(HANDLE hfile)
HeapFree( GetProcessHeap(), 0, mh );
return NULL;
}
if(mh->mtVersion != MFVERSION || mh->mtHeaderSize != size / 2) {
HeapFree( GetProcessHeap(), 0, mh );
return NULL;
}
size = mh->mtSize * 2;
mh = HeapReAlloc( GetProcessHeap(), 0, mh, size );
if(!mh) return NULL;