Merge pull request #4838 from sashashura/patch-10
Fixes Heap-buffer-overflow READ 1 in Assimp::ObjFileParser::getFacepull/4824/head^2
commit
5c763f471c
|
@ -440,7 +440,7 @@ void ObjFileParser::getFace(aiPrimitiveType type) {
|
|||
const bool vt = (!m_pModel->mTextureCoord.empty());
|
||||
const bool vn = (!m_pModel->mNormals.empty());
|
||||
int iPos = 0;
|
||||
while (m_DataIt != m_DataItEnd) {
|
||||
while (m_DataIt < m_DataItEnd) {
|
||||
int iStep = 1;
|
||||
|
||||
if (IsLineEnd(*m_DataIt)) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2021, assimp team
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
@ -111,6 +111,10 @@ inline Char_T getNextToken(Char_T pBuffer, Char_T pEnd) {
|
|||
*/
|
||||
template <class char_t>
|
||||
inline char_t skipLine(char_t it, char_t end, unsigned int &uiLine) {
|
||||
if (it >= end) {
|
||||
return it;
|
||||
}
|
||||
|
||||
while (!isEndOfBuffer(it, end) && !IsLineEnd(*it)) {
|
||||
++it;
|
||||
}
|
||||
|
@ -129,7 +133,7 @@ inline char_t skipLine(char_t it, char_t end, unsigned int &uiLine) {
|
|||
|
||||
/**
|
||||
* @brief Get a name from the current line. Preserve space in the middle,
|
||||
* but trim it at the end.
|
||||
* but trim it at the end.
|
||||
* @param[in] it set to current position
|
||||
* @param[in] end set to end of scratch buffer for readout
|
||||
* @param[out] name Separated name
|
||||
|
|
Loading…
Reference in New Issue