Searching in a sorted 2D matrix
Your algorithm is not efficient (thats the brutal part of the answer).

Searching in a list of  t values is a task that can be accomplished using O(log(t)) comparisons. Here we have t=m*n values so it should be accomplished using O(log(m*n)) = O(log(m))+O(log(n)) comparisons. I suspect your algorithm may execute the while loop about matrix.length times so it is not O(log(m)) (where m is the number of rows). 

The algorithm could work in the following way:


if the searched value is smaller then the first column in the first row then the searched value is not contained in the matrix.
Then do a binary search on the first column of the matrix to find the largest  entry smaller or equal to the searchd value
if the value found macthes you are done. 
otherwise do a binary search on the row found. 
if the value found matches the searched value you are done
otherwise the searched value is not in the matrix


Annother way is to treat the problem like a single dimension sorted array as it is proposed in the comment of @Azar. 

Even a small piece of code can have a lot of errors so it does make sense to try to use library methods to accomplish this task and not implement the binary search by yourself (but I don't know if this is the intention of the poser of the problem).

This blog entry discusses an example of a buggy implementation in Java. It references the following SUN  bug report because there was an errornous implementation of the binary search even in the JDK.