Commit d9484ee3 authored by André Anjos's avatar André Anjos 💬
Browse files

Fixed bug in drawing (x>=0 and y>=0 was not tested => possible SEGFAULT), from...

Fixed bug in drawing (x>=0 and y>=0 was not tested => possible SEGFAULT), from Manuel Guenther @ b600be99a
parent 4eb27ad2
......@@ -70,7 +70,7 @@ namespace bob { namespace ip {
*/
template <typename T>
void try_draw_point (blitz::Array<T,2>& image, int y, int x, T color) {
if (x >= image.extent(1) || y >= image.extent(0)) return;
if (x < 0 || y < 0 || x >= image.extent(1) || y >= image.extent(0)) return;
draw_point_(image, y, x, color);
}
......@@ -81,7 +81,7 @@ namespace bob { namespace ip {
template <typename T>
void try_draw_point (blitz::Array<T,3>& image, int y, int x,
const boost::tuple<T,T,T>& color) {
if (x >= image.extent(2) || y >= image.extent(1)) return;
if (x < 0 || y < 0 || x >= image.extent(2) || y >= image.extent(1)) return;
draw_point_(image, y, x, color);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment