I think `CV_Assert(!src.empty())` will be better. Same for next line.