Twinklebear / tobj

Tiny OBJ Loader in Rust
MIT License
233 stars 47 forks source link

Converter crashes if model references index that's out of bounds #18

Closed ondrowan closed 4 years ago

ondrowan commented 4 years ago
v 0 0 0
v 1 0 0
v 0 1 0
v 2 0 0
v 3 0 0
v 2 1 0

o Triangle1
f 1 2 3

o Triangle2
f 4 5 7

crashes the converter since there's no vertex with index 7. I'd suggest this could result in LoadError.

Twinklebear commented 4 years ago

Agreed that this should return a load error, I'll fix this. Thanks for the bug report @ondrowan

Twinklebear commented 4 years ago

Should be resolved in b798027c11d0fa9c7bb1af26a386968a38143d36 , I'll push a release shortly to crates

ondrowan commented 4 years ago

@Twinklebear Thanks for a quick fix!