summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJosh Andler <scislac@gmail.com>2007-07-10 20:39:45 +0000
committerscislac <scislac@users.sourceforge.net>2007-07-10 20:39:45 +0000
commit2c54cbf5fd085ea18bfe49b3b95b1bcdcd1d1321 (patch)
tree02932db9b111057ac1d303a5aa60ace8ef2a9cee /src
parentpatch 1741941 (diff)
downloadinkscape-2c54cbf5fd085ea18bfe49b3b95b1bcdcd1d1321.tar.gz
inkscape-2c54cbf5fd085ea18bfe49b3b95b1bcdcd1d1321.zip
patch by gorodish, fixes bug 1692611 (win32 EMF crash)
(bzr r3222)
Diffstat (limited to 'src')
-rw-r--r--src/extension/internal/emf-win32-inout.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/extension/internal/emf-win32-inout.cpp b/src/extension/internal/emf-win32-inout.cpp
index eb4995885..59f538ab9 100644
--- a/src/extension/internal/emf-win32-inout.cpp
+++ b/src/extension/internal/emf-win32-inout.cpp
@@ -505,6 +505,15 @@ myEnhMetaFileProc(HDC hDC, HANDLETABLE *lpHTable, ENHMETARECORD *lpEMFR, int nOb
if (pEmr->nHandles) {
d->n_obj = pEmr->nHandles;
d->emf_obj = new EMF_OBJECT[d->n_obj];
+
+ // Init the new emf_obj list elements to null, provided the
+ // dynamic allocation succeeded.
+ if ( d->emf_obj != NULL )
+ {
+ for( unsigned int i=0; i < d->n_obj; ++i )
+ d->emf_obj[i].lpEMFR = NULL;
+ } //if
+
} else {
d->emf_obj = NULL;
}
@@ -1349,7 +1358,7 @@ EmfWin32::open( Inkscape::Extension::Input *mod, const gchar *uri )
delete_object(&d, i);
delete[] d.emf_obj;
}
-
+
if (d.style.stroke_dash.dash)
delete[] d.style.stroke_dash.dash;