ChuckDanglars / exposure-render

Automatically exported from code.google.com/p/exposure-render
0 stars 0 forks source link

Please Check for access-violation in camera.cuh::update #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

Hi, please check if you write out of m_data. 
It does here, overwriting other stuff, so I appended

&& i < MAX_BOKEH_DATA-1;

I would be glad if you could provide me with some information how to correct it 
properly, since I have no clue what Update does .

Thanks
Christoph

HOD void Update(const float& FStop)
{
// Update bokeh
    int Ns = (int)m_NoBlades;

    if ((Ns >= 3) && (Ns <= 6))
    {
        float w = m_Rotation * PI_F / 180.0f, wi = (2.0f * PI_F) / (float)Ns;

        Ns = (Ns + 2) * 2;

        for (int i = 0; i < Ns  && i < MAX_BOKEH_DATA-1; i += 2)
        {
            m_Data[i]       = cos(w);
            m_Data[i + 1]   = sin(w);
            w += wi;
        }
    }
}

Original issue reported on code.google.com by c.web...@yahoo.de on 1 Jun 2012 at 9:51