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

This commit is contained in:
Dmitry Timoshkov 2004-06-18 19:33:41 +00:00 committed by Alexandre Julliard
parent 5d8effce0f
commit ac42c45745
1 changed files with 6 additions and 1 deletions

View File

@ -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 {