From 1b409fff8b3cd1cf63e990dcfeaaadf0100bd7f6 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 30 Jun 2016 11:12:45 +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 883c1219f..95721efc9 100644 --- a/src/osgPlugins/stl/ReaderWriterSTL.cpp +++ b/src/osgPlugins/stl/ReaderWriterSTL.cpp @@ -407,7 +407,10 @@ bool fileComesFromMagics(FILE *fp, osg::Vec4& magicsColor) size_t bytes_read = fread((void*) &header, sizeof(header), 1, fp); if (bytes_read!=sizeof(header)) return false; - ::fseek(fp, sizeof_StlHeader, SEEK_SET); + if (::fseek(fp, sizeof_StlHeader, SEEK_SET)!=0) + { + return false; + } std::string magicsColorPattern ("COLOR="); std::string headerStr = std::string(header);