Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
45e89f6b
Commit
45e89f6b
authored
Jul 22, 2018
by
LEFEBVREJP email
Browse files
Fixing overflow of clear_connected_components where starting point is zero and direction is -1.
parent
d7cf44b8
Pipeline
#14243
passed with stages
in 13 minutes and 13 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
radixalgorithm/marchingsquares.i.hh
View file @
45e89f6b
...
...
@@ -31,10 +31,10 @@ void MarchingSquares<data_type>::clear_connected_component(int row, int col,
// search neighbors
for
(
int
direction
=
0
;
direction
<
4
;
++
direction
)
{
size_
t
nc
=
col
+
dx
[
direction
];
size_
t
nr
=
row
+
dy
[
direction
];
if
(
nc
<
0
||
nc
=
=
mColumns
)
continue
;
// out of bounds
if
(
nr
<
0
||
nr
=
=
mRows
)
continue
;
// out of bounds
in
t
nc
=
col
+
dx
[
direction
];
in
t
nr
=
row
+
dy
[
direction
];
if
(
nc
<
0
||
nc
>
=
mColumns
)
continue
;
// out of bounds
if
(
nr
<
0
||
nr
>
=
mRows
)
continue
;
// out of bounds
size_t
nc_i
=
mColumns
*
nr
+
nc
;
if
(
mBit
[
nc_i
]
==
label
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment