From b908ced20c09954c7e110258a5a3892bbc26e9fa Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 16 Jul 2015 11:01:35 +0000 Subject: [PATCH] Added check to catch cases where the backdrop coordinate cache is too small for the number of contexts being computed. git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14961 16af8721-9629-0410-8352-f15c8da7e697 --- src/osgText/Text.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osgText/Text.cpp b/src/osgText/Text.cpp index 84e71b378..798a23d7b 100644 --- a/src/osgText/Text.cpp +++ b/src/osgText/Text.cpp @@ -811,6 +811,12 @@ void Text::computeBackdropPositions(unsigned int contextID) const } for( ; backdrop_index < max_backdrop_index; backdrop_index++) { + if (contextID >= glyphquad._transformedBackdropCoords[backdrop_index].size()) + { + // contextID exceeds one setup for glyphquad._transformedBackdropCoords, ignore this request. + continue; + } + GlyphQuads::Coords3& transformedCoords = glyphquad._transformedBackdropCoords[backdrop_index][contextID]; unsigned int numCoords = coords2->size(); if (numCoords!=transformedCoords->size())