* Fix conditional check in SkipSpaces function to prevent out-of-bound access.
The `SkipSpaces` function's condition was updated to ensure that the pointer check `in != end` is evaluated before dereferencing the pointer. This change prevents potential out-of-bound access when the input pointer reaches the end.
* Avoid input is wrong
* Fix all in != end
* Fix some minor bugs
* Change size to capacity
* Obj: Fix unittest
The `ObjFileParser::getFace` method failed to recognize the vertical tab
character (`\v`, 0x0b) as a separator. While the `IsSpaceOrNewLine`
utility handles most whitespace (space, tab, CR, LF, FF), it excludes
`\v`.
When encountering a vertical tab, the parser fell through to an `else`
block that calls `::atoi(&(*m_DataIt))`. Because `atoi` treats `\v` as
whitespace per the C standard, it skips the character and continues
reading. If `\v` is located at the end of the buffer (e.g., followed by
a newline at the buffer boundary), `atoi` can read past the allocated
memory, triggering a heap-buffer-overflow.
This fix explicitly checks for `\v` and treats it as a separator,
resetting the position counter and preventing the invalid `atoi` call.
Verified with AddressSanitizer and confirmed that all 584 existing unit
tests pass.
Fixes: https://issues.oss-fuzz.com/issues/476180586
Signed-off-by: Bill Wendling <morbo@google.com>
Co-authored-by: Meder Kydyraliev <meder@google.com>
Co-authored-by: CodeMender <codemender-patching@google.com>
* Add BOM skip and fix mtl parsing
* Remove old code
* Fix#5635
* Add all attributes to ObjFileData
---------
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* Fix parsing of comments at the end of lines for tokens with variable number of elements. (#5890)
* Fixed Quality Gate issues.
Reduced nesting of the break statements.
---------
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
- std::min/max were not defined in StackAllocator.inl; Also added explicit template arguments to break macro expansion if Windows.h is included prior and NOMINMAX macro is not present.
- Made static_assert statements compatible with C++11 in ProcessHelper.cpp.
- Removed unused string_view include in ObjFileParser.cpp.
The omitted vertex colors are treated as (0, 0, 0, 1).
e.g
v 0.0 0.0 0.0
v 0.0 0.0 1.0 0.0 0.0 0.0
v 0.0 1.0 0.0
v 1.0 0.0 0.0 1.0 0.6 0.3
v 1.0 1.0 0.0