Commit ac42c457 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Do not allow creation of not aligned EMF records by GDI code.

parent 5d8effce
......@@ -18,6 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <assert.h>
#include <stdarg.h>
#include <string.h>
......@@ -186,11 +187,15 @@ BOOL EMFDRV_WriteRecord( PHYSDEV dev, EMR *emr )
ENHMETAHEADER *emh;
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dev;
TRACE("record %ld, size %ld %s\n",
emr->iType, emr->nSize, physDev->hFile ? "(to disk)" : "");
assert( !(emr->nSize & 3) );
physDev->emh->nBytes += emr->nSize;
physDev->emh->nRecords++;
if(physDev->hFile) {
TRACE("Writing record to disk\n");
if (!WriteFile(physDev->hFile, (char *)emr, emr->nSize, NULL, NULL))
return FALSE;
} else {
......
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