Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11738


Ignore:
Timestamp:
Feb 11, 2018, 11:31:58 PM (6 years ago)
Author:
landauf
Message:

[AsteroidMining_HS17] fixed two buffer overflows that caused random crashes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Presentation_HS17_merge/src/modules/asteroidmining/AsteroidMinable.cc

    r11736 r11738  
    279279        int z = 0;
    280280        float dProbA = 1.0/(a*a + 3.0*a + 2.0); // one 'probability unit' for discrete ramp function. Gauss stuff.
    281         for(z = 0; z<=a; ++z){probDensity[z] = (z+1)*dProbA; } // rising part
     281        for(z = 0; z<a; ++z){probDensity[z] = (z+1)*dProbA; } // rising part
    282282
    283283        float dProbB = 1.0/(b*b +3.0*b + 2.0);
    284         for(z = 0; z<b; ++z){probDensity[c-z] = (z+1)*dProbB;} // falling part
     284        for(z = 0; z<b; ++z){probDensity[c-1-z] = (z+1)*dProbB;} // falling part
    285285   
    286286        // // Just for testing:
Note: See TracChangeset for help on using the changeset viewer.