Dynamically allocate disparity map array to fix bug