I'm having some problems with the following code. newrows is a parameter which is directly given to the function I'm working in. elements is being calculated a bit earlier using another parameter. Somehow, for some combinations of values for newrows and elements I'm getting a core dump while other combinations work fine. Usually, when the core dump occurs there have been 20000 to 25000 iterations. However, when everything works fine there have been up to 40000 iterations.
int32_t newimage[newrows][elements][3];
int32_t pixelcounter[newrows][elements];
//int32_t norm, angle, rohmax;
//double r, alpha, beta, m, mu;
//initialize arrays
for(i=0; i<newrows; i++){
for(j=0; j<elements; j++){
pixelcounter[i][j] = 0;
newimage[i][j][0] = 0;
newimage[i][j][1] = 0;
newimage[i][j][2] = 0;
}
}
combination that works fine: 200 : 188
combination that leads to core dump: 200 : 376
I am using linux btw :-)