From 14620aa1ddbdba3043472fb26871ea590f21fe6c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 6 Nov 2014 10:44:27 +0000 Subject: [PATCH] From Pjotr Svetachov, "I tried your fix and it exposed a bug in my fix :) The problem is that the readObjectFields method will add the object to the _identifierMap. So all the other instances of that image in the same file will be replaced by the created dummy object. In my fix this was an dummy image and I didn't notice it in our scene's, probably because it covered a small part of an object. In your fix the dummy object was not an image and that leads to a crash when something tries to use it as an image. I have attached a small fix for this bug. " git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14471 16af8721-9629-0410-8352-f15c8da7e697 --- src/osgDB/InputStream.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/osgDB/InputStream.cpp b/src/osgDB/InputStream.cpp index 816de6a96..cb6b5c62f 100644 --- a/src/osgDB/InputStream.cpp +++ b/src/osgDB/InputStream.cpp @@ -797,6 +797,7 @@ osg::Image* InputStream::readImage(bool readFromExternal) // we don't want to overwrite the properties of the image in the cache as this could cause theading problems if the object is currently being used // so we read the properties from the file into a dummy object and discard the changes. osg::ref_ptr temp_obj = readObjectFields("osg::Object", id, _dummyReadObject.get() ); + _identifierMap[id] = image; } else {