Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
3934d61d
Commit
3934d61d
authored
Sep 03, 2015
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed uninitialized memory writing/reading in flann
parent
a98ee0d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
kmeans_index.h
modules/flann/include/opencv2/flann/kmeans_index.h
+3
-1
No files found.
modules/flann/include/opencv2/flann/kmeans_index.h
View file @
3934d61d
...
...
@@ -384,6 +384,8 @@ public:
}
root_
=
pool_
.
allocate
<
KMeansNode
>
();
std
::
memset
(
root_
,
0
,
sizeof
(
KMeansNode
));
computeNodeStatistics
(
root_
,
indices_
,
(
int
)
size_
);
computeClustering
(
root_
,
indices_
,
(
int
)
size_
,
branching_
,
0
);
}
...
...
@@ -823,11 +825,11 @@ private:
variance
-=
distance_
(
centers
[
c
],
ZeroIterator
<
ElementType
>
(),
veclen_
);
node
->
childs
[
c
]
=
pool_
.
allocate
<
KMeansNode
>
();
std
::
memset
(
node
->
childs
[
c
],
0
,
sizeof
(
KMeansNode
));
node
->
childs
[
c
]
->
radius
=
radiuses
[
c
];
node
->
childs
[
c
]
->
pivot
=
centers
[
c
];
node
->
childs
[
c
]
->
variance
=
variance
;
node
->
childs
[
c
]
->
mean_radius
=
mean_radius
;
node
->
childs
[
c
]
->
indices
=
NULL
;
computeClustering
(
node
->
childs
[
c
],
indices
+
start
,
end
-
start
,
branching
,
level
+
1
);
start
=
end
;
}
...
...
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