fix buffer overrun of "std::vector<int> sorted_indices".
In DecreasingPartialArgSort() function, up to (num_boxes + max_detections) elements of sorted_indices will be overwritten. However, sorted_indices has only (max_detections) capacity, so that It cause buffer overrun. So I increased the size of sorted_indices.
This commit is contained in:
parent
6a96e865fa
commit
769d2a531b
@ -498,7 +498,7 @@ TfLiteStatus NonMaxSuppressionMultiClassRegularHelper(TfLiteContext* context,
|
||||
|
||||
int size_of_sorted_indices = 0;
|
||||
std::vector<int> sorted_indices;
|
||||
sorted_indices.resize(max_detections);
|
||||
sorted_indices.resize(num_boxes + max_detections);
|
||||
std::vector<float> sorted_values;
|
||||
sorted_values.resize(max_detections);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user