-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CodeClean] fix svace issue #4462
[CodeClean] fix svace issue #4462
Conversation
89811b4
to
69e95af
Compare
@@ -727,7 +727,8 @@ gst_tensor_query_client_chain (GstPad * pad, | |||
data_h = g_async_queue_timeout_pop (self->msg_queue, | |||
self->timeout * G_TIME_SPAN_MILLISECOND); | |||
if (data_h) { | |||
self->requested_num--; | |||
if (self->requested_num > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need { } in lines 730 to 769?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, pushing buffer to downstream element occurs when a data processed from query-server in the queue.
self->requested_num--; | ||
ret = nns_edge_data_get_count (data_h, &num_data); | ||
|
||
if (ret == NNS_EDGE_ERROR_NONE && num_data > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry,
Should code(line 732 ~ 769) be done when self->requested_num > 0
is TRUE ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually unnecessary. The param self->requested_num
is required for limiting max input to query-server.
query-client handles the response from query-server by using msg-queue.
69e95af
to
b201910
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -173,10 +173,15 @@ PYConverterCore::convert (GstBuffer *in_buf, GstTensorsConfig *config) | |||
|
|||
if (output) { | |||
GstTensorInfo *_info; | |||
unsigned int num_tensors = PyList_Size (output); | |||
unsigned int num_tensors = (unsigned int) PyList_Size (output); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return of PyList_Size
coud be negative, so how about checking error ?
unsigned int num_tensors = NNS_TENSOR_SIZE_LIMIT + 1;
Py_ssize_t out_len = PyList_Size (output);
if (out_len >= 0)
num_tensors = (unsigned int) out_len;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed param type (Py_ssize_t), please review the changes again.
c826e40
to
6bd4dcb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Code clean, fix svace issues. - check max number of tensors and prevent underflow. Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
6bd4dcb
to
0e0473e
Compare
Code clean, fix svace issues.