void dfs(vector<vector<char> >&vec,int i,int j){
if(vec[i][j]=='O'){
vec[i][j]='Y';
if(i > 0) dfs(vec,i1,j);
if(j > 1) dfs(vec,i,j1); //here it is supposed to be j > 0, however it brings me runtime error if I do that
if(i+1 < m) dfs(vec,i+1,j);
if(j+1 < n) dfs(vec,i,j+1);
}
}
Simple Code, wired error, anyone can help?

It seems to be answered in "https://leetcode.com/discuss/42445/areallysimpleandreadablecsolution，onlycost12ms". The run time error comes from stack overflow.