Doubt regarding Rat in a Maze Problem

My code is working fine in eclipse . But test cases are failing due to rum time error . Can you tell me which line is leading to run time error ?
Here is my code :

import java.util.*;
public class Main {
public static void main(String args[]) {
// Your Code Here
Scanner scan = new Scanner(System.in) ;
int row = scan.nextInt() ;
int col = scan.nextInt() ;
char[][] maze = new char[row][col] ;
int[][] solBoard = new int[row][col] ;
for(int i = 0 ; i < row ; i ++){
for(int j = 0 ; j < col ; j ++){
maze[i][j] = scan.next().charAt(0) ;
}
}
if(ratMaze(maze,0,0,solBoard))
display(solBoard) ;
else
System.out.print(-1) ;

}

public static boolean ratMaze(char[][] maze , int row , int col , int[][] solBoard){

	
	if(row == maze.length){
		return false ;
	}

	if(col == maze[0].length){
		return false ;
	}

	if(maze[row][col] == 'X'){
		return false ;
	}

	if(row == maze.length -1 && col == maze[0].length-1){
		solBoard[row][col] = 1 ;
		return true ;
	}


	//boolean res = false ;
	solBoard[row][col] = 1 ;

	boolean right = ratMaze(maze , row , col+1 , solBoard) ;

	if(!right){
		boolean down = ratMaze(maze,row+1,col,solBoard) ;
		if(right || down){
			return true ;
		}
		else{
			solBoard[row][col] = 0 ;
			return false ;
		}
	}


return right ;
}

public static void display(int[][] solBoard){

	for(int i = 0 ; i < solBoard.length ; i ++){
		for(int j = 0 ; j < solBoard[0].length ; j ++){
			System.out.print(solBoard[i][j]+" ") ;
		}
		System.out.println() ;
	}
}

}

@Lalit2142,
I see that you have successfully submitted the question. Do you have any other doubts regarding the question?

No , I don’t have any other doubts . Thanks for responding

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.