POV-Ray : Newsgroups : povray.programming : Segfault due to short int overflow at bbox.cpp:596 : Segfault due to short int overflow at bbox.cpp:596 Server Time
17 May 2024 05:34:05 EDT (-0400)
  Segfault due to short int overflow at bbox.cpp:596  
From: Eric Buddington
Date: 27 Dec 2005 00:00:01
Message: <web.43b0c972a307566187938cd40@news.povray.org>
POV-Ray 3.6.1
bbox.cpp:596

If there are too many (>32k) infinite objects, the short int index 'i'
overflows
and attempts to reference Infinite[-32767], which naturally spews core.

I suggest throwing an error in the case of overflow, and perhaps bumping up
'i' to an unsigned int, if there's any sane scene that uses 32k infinite
objects.

Less critically, I'd suggest moving the declaration of 'i' to the top of the
block enclosing the 'for' loop, or into the 'for' loop itself. It would
make the code a little easier to read, though I don't know what your coding
standards are.

-Eric


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.