From cd4a51cf67530457352b5cf3d5e56d5357c63226 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 30 Jun 2016 11:11:00 +0100 Subject: [PATCH] Added handling of return value --- src/osgPlugins/stl/ReaderWriterSTL.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osgPlugins/stl/ReaderWriterSTL.cpp b/src/osgPlugins/stl/ReaderWriterSTL.cpp index c21491c69..883c1219f 100644 --- a/src/osgPlugins/stl/ReaderWriterSTL.cpp +++ b/src/osgPlugins/stl/ReaderWriterSTL.cpp @@ -680,7 +680,10 @@ ReaderWriterSTL::ReaderObject::ReadResult ReaderWriterSTL::BinaryReaderObject::r bool comesFromMagics = fileComesFromMagics(fp, magicsHeaderColor); // seek to beginning of facets - ::fseek(fp, sizeof_StlHeader, SEEK_SET); + if (::fseek(fp, sizeof_StlHeader, SEEK_SET)!=0) + { + return ReadError; + } StlFacet facet; for (unsigned int i = 0; i < _expectNumFacets; ++i)