From 9b1107eb641a259e3b224b1ebf18ab5758c164b5 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 30 Jun 2016 08:27:49 +0100 Subject: [PATCH] Improved check against number of bytes read --- src/osgPlugins/md2/ReaderWriterMD2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/md2/ReaderWriterMD2.cpp b/src/osgPlugins/md2/ReaderWriterMD2.cpp index 65dab9078..dd9d6bf73 100644 --- a/src/osgPlugins/md2/ReaderWriterMD2.cpp +++ b/src/osgPlugins/md2/ReaderWriterMD2.cpp @@ -172,7 +172,7 @@ load_md2 (const char *filename, const osgDB::ReaderWriter::Options* options) return NULL; } - if (read(file_fd, mapbase, st.st_size)==0) + if (read(file_fd, mapbase, st.st_size) != st.st_size) { close (file_fd); if (mapbase) free(mapbase);