From 143d423d1f8b88cc908faa44396fd70ab9ae14ab Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 2 Jul 2016 12:39:06 +0100 Subject: [PATCH] Added handling of return type --- src/osgPlugins/txp/ReaderWriterTXP.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osgPlugins/txp/ReaderWriterTXP.cpp b/src/osgPlugins/txp/ReaderWriterTXP.cpp index 20fa69e8a..8693ba742 100644 --- a/src/osgPlugins/txp/ReaderWriterTXP.cpp +++ b/src/osgPlugins/txp/ReaderWriterTXP.cpp @@ -77,7 +77,11 @@ osgDB::ReaderWriter::ReadResult ReaderWriterTXP::local_readNode(const std::strin { int x,y,lod; unsigned int id; - sscanf(name.c_str(),"tile%d_%dx%d_%u",&lod,&x,&y,&id); + if (sscanf(name.c_str(),"tile%d_%dx%d_%u",&lod,&x,&y,&id)!=4) + { + return ReadResult::ERROR_IN_READING_FILE; + } + osg::ref_ptr< TXPArchive > archive = getArchive(id,osgDB::getFilePath(file)); if (archive == NULL) return ReadResult::ERROR_IN_READING_FILE;