I believe that your algorithm does not have the time bounds that you believe that it does.
To see this, for simplicity let's assume that your grid is an n x n square (let's call this size m). If I can derive a different time bound than O(log n) in this case, I can argue that what you have should not be correct.
In particular, notice that in the worst case you make three recursive calls to problems that are of size (n / 2) x (n / 2) = m / 4. This means that we have the recurrence
T(1) = 1
T(m) = 3T(m / 4) + O(1)
Using the Master Theorem, the runtime for this function would be O(mlog43) = O(n2 log43) = O(n log49) ≈ O(n1.5849625). This is ω(log n + log m); that is, it's asymptotically strictly greater.
As many other people have posted, there are several well-known algorithms that run in O(m + n) that are based by walking one step in the right direction at each step. Consequently, correctness aside, I would not advise using the algorithm you've posted.