]> git.mxchange.org Git - simgear.git/commit
Avoid a divide-by-zero on malformed BTG files.
authorJames Turner <zakalawe@mac.com>
Thu, 17 Oct 2013 19:13:36 +0000 (20:13 +0100)
committerJames Turner <zakalawe@mac.com>
Thu, 17 Oct 2013 19:13:50 +0000 (20:13 +0100)
commit8b0c246a7b6fc31fc7fec715ec4e6f6785314889
tree65f270de994b3d0b1f82eb9c94da6963d244e3e4
parent9c4face1aee0b8dc1972249e2325fc2c74ae43ad
Avoid a divide-by-zero on malformed BTG files.

Encountered while testing v850 airports; some airports
generate materials with no tris, and hence no indices.
This causes a divide-by-zero when computing the index stride.

Detect this, and convert the BTG reader to throw exceptions
in error conditions, and to catch this and report the
appropriate result code.
simgear/io/sg_binobj.cxx
simgear/scene/tgdb/SGReaderWriterBTG.cxx