Skip to content

Commit

Permalink
HybridBinarizer: fix buffer overflow regression
Browse files Browse the repository at this point in the history
  • Loading branch information
axxel committed Feb 6, 2024
1 parent 89cac92 commit f14aaca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/HybridBinarizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static Matrix<T_t> SmoothThresholds(Matrix<T_t>&& in)
last = i;
}
}
std::fill(last + 1, out.end(), *last);
std::fill(last + 1, out.end(), *(std::max(last, out.begin())));

return out;
}
Expand Down

0 comments on commit f14aaca

Please sign in to comment.