From 095a69753592934fb2964bbdb6b2c8fe34e14074 Mon Sep 17 00:00:00 2001 From: Paolo Cignoni Date: Thu, 24 Nov 2016 18:02:07 +0100 Subject: [PATCH] added a check for empty lines in obj (to avoid out of bound accesses) --- wrap/io_trimesh/import_obj.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wrap/io_trimesh/import_obj.h b/wrap/io_trimesh/import_obj.h index 84c06cba..cdedc588 100644 --- a/wrap/io_trimesh/import_obj.h +++ b/wrap/io_trimesh/import_obj.h @@ -745,8 +745,8 @@ namespace vcg { std::getline(stream, line); // We have to manage backspace terminated lines, // joining them together before parsing them - if(line.back()==13) line.pop_back(); - while(line.back()=='\\') { + if(!line.empty() && line.back()==13) line.pop_back(); + while(!line.empty() && line.back()=='\\') { std::string tmpLine; std::getline(stream, tmpLine); if(tmpLine.back()==13) line.pop_back();