Commit d6d64196 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

gdi: Metafile records must be at least 3 words long.

parent c0165091
...@@ -419,11 +419,10 @@ BOOL MF_PlayMetaFile( HDC hdc, METAHEADER *mh) ...@@ -419,11 +419,10 @@ BOOL MF_PlayMetaFile( HDC hdc, METAHEADER *mh)
mr = (METARECORD *)((char *)mh + offset); mr = (METARECORD *)((char *)mh + offset);
TRACE("offset=%04x,size=%08lx\n", TRACE("offset=%04x,size=%08lx\n",
offset, mr->rdSize); offset, mr->rdSize);
if (!mr->rdSize) { if (mr->rdSize < 3) { /* catch illegal record sizes */
TRACE( TRACE("Entry got size %ld at offset %d, total mf length is %ld\n",
"Entry got size 0 at offset %d, total mf length is %ld\n", mr->rdSize,offset,mh->mtSize*2);
offset,mh->mtSize*2); break;
break; /* would loop endlessly otherwise */
} }
offset += mr->rdSize * 2; offset += mr->rdSize * 2;
PlayMetaFileRecord( hdc, ht, mr, mh->mtNoObjects ); PlayMetaFileRecord( hdc, ht, mr, mh->mtNoObjects );
......
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