From e42c56022312b55f2fd4de43525329a359920075 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 19 Feb 2009 17:34:35 +0000 Subject: [PATCH] Fixed bug in checking if numRead values. --- src/osgPlugins/hdr/hdrloader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osgPlugins/hdr/hdrloader.cpp b/src/osgPlugins/hdr/hdrloader.cpp index 8ab87230e..220b0bacd 100644 --- a/src/osgPlugins/hdr/hdrloader.cpp +++ b/src/osgPlugins/hdr/hdrloader.cpp @@ -60,7 +60,7 @@ bool HDRLoader::isHDRFile(const char *_fileName) fclose(file); - if (numRead<10) return false; + if (numRead<1) return false; if (memcmp(str, "#?RADIANCE", 10) && memcmp(str, "#?RGBE", 6)) return false; @@ -80,7 +80,7 @@ bool HDRLoader::load(const char *_fileName, const bool _rawRGBE, HDRLoaderResult size_t numRead = fread(str, 10, 1, file); - if (numRead<10) + if (numRead<1) { fclose(file); return false; @@ -90,7 +90,7 @@ bool HDRLoader::load(const char *_fileName, const bool _rawRGBE, HDRLoaderResult { fseek(file, 0, SEEK_SET); numRead = fread(str, 6, 1, file); - if (numRead<6 || memcmp(str, "#?RGBE", 6)) + if (numRead<1 || memcmp(str, "#?RGBE", 6)) { fclose(file); return false;