Skip to content

Commit 392e4d8

Browse files
Log the name of the file that causes Mat::Read() to checkfail (#1923)
Some of the CHECK statements in Mat::Read() do not log the name of the file that triggers them. This can cause crashes that are difficult to debug. Co-authored-by: Johannes Schönberger <joschonb@microsoft.com>
1 parent bd84ad6 commit 392e4d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/mvs/mat.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ void Mat<T>::Read(const std::string& path) {
164164
std::streampos pos = text_file.tellg();
165165
text_file.close();
166166

167-
CHECK_GT(width_, 0);
168-
CHECK_GT(height_, 0);
169-
CHECK_GT(depth_, 0);
167+
CHECK_GT(width_, 0) << path;
168+
CHECK_GT(height_, 0) << path;
169+
CHECK_GT(depth_, 0) << path;
170170
data_.resize(width_ * height_ * depth_);
171171

172172
std::fstream binary_file(path, std::ios::in | std::ios::binary);

0 commit comments

Comments
 (0)