mv_machine_learning: fix coverity issues 51/289951/1 accepted/tizen/unified/20230316.174023
authorInki Dae <inki.dae@samsung.com>
Thu, 16 Mar 2023 04:39:47 +0000 (13:39 +0900)
committerInki Dae <inki.dae@samsung.com>
Thu, 16 Mar 2023 04:39:47 +0000 (13:39 +0900)
[Version] : 0.27.5
[Issue type] : bug fix

Fixed coverity issues, DIVIDE_BY_ZERO.

Change-Id: I87311ac7c527ae6ac8d54ef5433b5b591bf6daf3
Signed-off-by: Inki Dae <inki.dae@samsung.com>
mv_machine_learning/inference/src/PoseDecoder.cpp
packaging/capi-media-vision.spec

index 223d75b..832077f 100644 (file)
@@ -297,6 +297,11 @@ int PoseDecoder::decode(float scaleWidth, float scaleHeight, float thresHoldRadi
                        mCandidates.pop_front();
                }
 
+               if (mHeatMapChannel == 0) {
+                       LOGE("mHeatMapChannel is 0. It shouldn't be 0.");
+                       return MEDIA_VISION_ERROR_INVALID_OPERATION;
+               }
+
                for (auto &pose : mPoseLandmarks) {
                        pose.score /= static_cast<float>(mHeatMapChannel);
                }
index a60dd01..43389e5 100644 (file)
@@ -1,6 +1,6 @@
 Name:        capi-media-vision
 Summary:     Media Vision library for Tizen Native API
-Version:     0.27.4
+Version:     0.27.5
 Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0 and BSD-3-Clause