From 2f14255dd7b4a1aa4c0b093cdede0a1b3a246905 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 9 Sep 2010 10:17:55 +0000 Subject: [PATCH] From Joachim Pouderoux, "Please find attached a very small fix for the DXF reader. The bug made OSG crash with some files. Actually, itr was incremented into the loop and after the test with nlist.end(). Then, the unreferencing of itr when nlist is equals to nlist.end() caused the crash." --- src/osgPlugins/dxf/dxfEntity.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/osgPlugins/dxf/dxfEntity.cpp b/src/osgPlugins/dxf/dxfEntity.cpp index a5fb2ef2f..e1bd1d3a8 100644 --- a/src/osgPlugins/dxf/dxfEntity.cpp +++ b/src/osgPlugins/dxf/dxfEntity.cpp @@ -594,8 +594,7 @@ dxfPolyline::drawScene(scene* sc) double bad_c = 0; double good_c = 0; long bad=0,good=0; - for (; itr != nlist.end(); ) { - ++itr; + for (; itr != nlist.end(); ++itr) { if ((*itr)== lastn) continue; Vec3d diff = ((*itr)-lastn); diff.normalize();