In some .obj files, there's a stray 'g' followed by a newline at the
very end of the file. What happens right now is that *p++ skips past the
"terminating newline", and then proceeds to process out of bounds memory
which leads to a crash.
I'm not sure if 'g' can actually be empty per spec, so this change just
fixes the crash without resetting the group to "default" or anything
like that; 'v'/'f' shouldn't be empty but this would fix crashing when
parsing malicious/malformed .obj files as well.
In some .obj files, there's a stray 'g' followed by a newline at the very end of the file. What happens right now is that *p++ skips past the "terminating newline", and then proceeds to process out of bounds memory which leads to a crash.
I'm not sure if 'g' can actually be empty per spec, so this change just fixes the crash without resetting the group to "default" or anything like that; 'v'/'f' shouldn't be empty but this would fix crashing when parsing malicious/malformed .obj files as well.