#124 tin_viewer: sometimes uninitialised variables are used

v2.1.0
closed
nobody
None
5
2014-04-21
2011-08-29
No

In ./modules/tin/tin_viewer/tin_view_control.cpp , line 766,767, s and a are uninitialised if C==0.0

Discussion

  • I just had a look at the current source, and can not find this case. The sources seem not to have changed since you filed this report, so I hopefully looked at the correct places. Seems like you are referring to

    case 2:
        {
            double  s, a;
    
            pTriangle->Get_Gradient(m_zField, s, a);
    
            s   = M_PI_090 - s;
            dim = (acos(sin(s) * sin(m_Light_Hgt) + cos(s) * cos(m_Light_Hgt) * cos(a - m_Light_Dir))) / M_PI_090;
        }
        break;
    

    But pTriangle->Get_Gradient(m_zField, s, a) will return -1 for both s and a in case C==0, see line 440/441 in https://sourceforge.net/p/saga-gis/code-0/911/tree/trunk/saga-gis/src/saga_core/saga_api/tin_elements.cpp

    I'm closing this thread, but please report back in case I misunderstood the problem.

     


Anonymous


Cancel   Add attachments