From 17ba6f0a24f70ff84ac26a4613a42fc589ad87a6 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 6 Mar 2012 10:35:57 +0000 Subject: [PATCH] From Guillaume Millet, "Please find a small fix to avoid crash of texture Atlas builder in case of textures with NULL image. If an object is comming with texture and NULL image, the texture atlas builder crash when sorting textures according to texture height. The fix is to skip textures with NULL image when inserting textures in the builder texture list. " --- src/osgUtil/Optimizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index c12a88496..95f818b02 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -4409,7 +4409,7 @@ void Optimizer::TextureAtlasVisitor::optimize() bool t_repeat = texture->getWrap(osg::Texture2D::WRAP_T)==osg::Texture2D::REPEAT || texture->getWrap(osg::Texture2D::WRAP_T)==osg::Texture2D::MIRROR; - if (!s_repeat && !t_repeat) + if (texture->getImage() && !s_repeat && !t_repeat) { _builder.addSource(*titr); }