POV-Ray : Newsgroups : povray.programming : media.cpp problem : media.cpp problem Server Time
4 Oct 2024 17:05:05 EDT (-0400)
  media.cpp problem  
From: Drew Kearns
Date: 30 Mar 2003 01:15:03
Message: <web.3e868a715f21c970e8cde3690@news.povray.org>
Hello all.  I am working on a complicated scene which currently causes
POVRay to crash with an application exception.  After spending some time
running the code through MSVC, I've narrowed the problem down to a memory
clobbering that seems to be happening in media.cpp in the function
get_lit_interval (1469).

WHen the clobbering happens, the function is called with:
1 members in light_list
10 members in local_light_list
5 elements in Lit_Interval

At line 1505 in media.cpp, "curr" is set to Lit_Interval[0], "n" is 0 and
"a" is 11.  In the FOR loop started at line 1535, the first IF statement
(s0[i] > prev->s1) evaluates to true for each member.  This causes "curr"
to be incremented twice per loop...and in the third loop starts romping
through RAM as the pointers are now outside of the Lit_Interval bounds.

Could someone who is more familiar with media.cpp take a look at this loop
from this point?  I'm not familiar enough with the code to second guess
what it's doing at this point...but it does seem odd to me that it's
incrementing thru the Lit_Intervals array based on the count of global and
local lights?

Thanks-
-Drew


Post a reply to this message

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