From c606604a7e4c759e225c8bb360a7d5b2c3e124f8 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 5 Jan 2011 11:43:37 +0000 Subject: [PATCH] Added check for invalid face size to prevent a crash --- src/osgText/GlyphGeometry.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/osgText/GlyphGeometry.cpp b/src/osgText/GlyphGeometry.cpp index 7dee68d75..8de748d34 100644 --- a/src/osgText/GlyphGeometry.cpp +++ b/src/osgText/GlyphGeometry.cpp @@ -691,6 +691,13 @@ OSGTEXT_EXPORT osg::Geometry* computeTextGeometry(osg::Geometry* glyphGeometry, // if we don't have a face we can't create any 3d text if (!face) return 0; + // face doesn't have enough vertices on it to represent a polygon. + if (face->size()<3) + { + OSG_NOTICE<<"Face does not have enough elements to be able to represent a polygon, face->size() = "<size()<