From c58b8740f1860924d59e1ca951a69b54acdbc5b0 Mon Sep 17 00:00:00 2001 From: Inki Dae Date: Fri, 2 Sep 2022 12:41:08 +0900 Subject: [PATCH] mv_machine_learning: fix coverity issues [Verion] : 0.23.22-0 [Issue type] : bug fix Fixed two coverity issues. Change-Id: I883415d8411b077164a8d804efd5d9aabacd5b1f Signed-off-by: Inki Dae --- mv_machine_learning/face_recognition/src/nntrainer_fvm.cpp | 4 +++- mv_machine_learning/training/src/label_manager.cpp | 4 +++- packaging/capi-media-vision.spec | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mv_machine_learning/face_recognition/src/nntrainer_fvm.cpp b/mv_machine_learning/face_recognition/src/nntrainer_fvm.cpp index 22658b3..b999e84 100644 --- a/mv_machine_learning/face_recognition/src/nntrainer_fvm.cpp +++ b/mv_machine_learning/face_recognition/src/nntrainer_fvm.cpp @@ -89,5 +89,7 @@ void NNTrainerFVM::WriteFeatureVec(vector& feature_vec, const int max_lab void NNTrainerFVM::Remove() { // Remove existing file forcely. - ::remove(_feature_vector_file.c_str()); + int ret = ::remove(_feature_vector_file.c_str()); + if (ret) + throw InvalidOperation("Fail to remove feature vector file."); } \ No newline at end of file diff --git a/mv_machine_learning/training/src/label_manager.cpp b/mv_machine_learning/training/src/label_manager.cpp index 6a4deb4..3e03a57 100644 --- a/mv_machine_learning/training/src/label_manager.cpp +++ b/mv_machine_learning/training/src/label_manager.cpp @@ -290,5 +290,7 @@ string LabelManager::GetLabelFromAnswer(const vector& result) void LabelManager::Remove() { // Remove existing files forcely. - ::remove(_label_file.c_str()); + int ret = ::remove(_label_file.c_str()); + if (ret) + throw InvalidOperation("Fail to remove label file."); } \ No newline at end of file diff --git a/packaging/capi-media-vision.spec b/packaging/capi-media-vision.spec index 8e19e4a..76f5f5b 100644 --- a/packaging/capi-media-vision.spec +++ b/packaging/capi-media-vision.spec @@ -1,6 +1,6 @@ Name: capi-media-vision Summary: Media Vision library for Tizen Native API -Version: 0.23.21 +Version: 0.23.22 Release: 0 Group: Multimedia/Framework License: Apache-2.0 and BSD-3-Clause -- 2.7.4