diff --git a/src/osgPlugins/gz/ReaderWriterGZ.cpp b/src/osgPlugins/gz/ReaderWriterGZ.cpp index a0566b957..e77464e10 100644 --- a/src/osgPlugins/gz/ReaderWriterGZ.cpp +++ b/src/osgPlugins/gz/ReaderWriterGZ.cpp @@ -261,8 +261,8 @@ bool ReaderWriterGZ::read(std::istream& fin, std::string& destination) const fin.read((char*)in, CHUNK); strm.avail_in = fin.gcount(); - - if (fin.fail()) + + if (fin.bad()) { (void)inflateEnd(&strm); return false;