thisistherk / fast_obj

Fast C OBJ parser
MIT License
616 stars 46 forks source link

Infinite loop / crash with invalid input #38

Open Kimbatt opened 2 years ago

Kimbatt commented 2 years ago

Hi, The following obj file causes the parse_face function to get stuck in an infinite loop: f f (3 letters only)

In the parse_face function, the pointer never gets advanced, because no valid integers could be read. Also, it will keep pushing new items into the array every iteration, so it will just run for a while, then it'll crash.