mv_3d: fix coverity issue 89/282089/3 accepted/tizen/unified/20220928.020828
authorsangho park <sangho.g.park@samsung.com>
Tue, 27 Sep 2022 03:49:37 +0000 (12:49 +0900)
committersangho park <sangho.g.park@samsung.com>
Tue, 27 Sep 2022 05:50:08 +0000 (05:50 +0000)
[Version] : 0.23.28-0
[Issue type] : bug fix

fix coverity DefectId 1612132, 1612134, 1612135 (Unchecked return value)

Change-Id: Ib618ab460996f40572e8084b743954eb7fad20c1
Signed-off-by: sangho park <sangho.g.park@samsung.com>
mv_3d/3d/src/Mv3d.cpp
packaging/capi-media-vision.spec

index 258307a..b63ad9a 100644 (file)
@@ -410,13 +410,17 @@ namespace mv3d
 
                        auto depthData = handle->mDfsAdaptor->getOutputData();
                        auto leftData = handle->mDfsAdaptor->getLeftData();
-                       mv_source_fill_by_buffer(handle->mInternalSource,
+                       int ret = mv_source_fill_by_buffer(handle->mInternalSource,
                                                                static_cast<unsigned char*>(leftData.data),
                                                                leftData.width,
                                                                leftData.height,
                                                                leftData.stride * leftData.height,
                                                                leftData.type == DFS_DATA_TYPE_UINT8C3 ? MEDIA_VISION_COLORSPACE_RGB888 :
                                                                                                MEDIA_VISION_COLORSPACE_Y800);
+                       if (MEDIA_VISION_ERROR_NONE != ret) {
+                               LOGW("Errors were occurred during source filling %i", ret);
+                               continue;
+                       }
                        handle->mDepthCallback(
                                        static_cast<mv_source_h>(handle->mInternalSource),
                                        static_cast<DepthTypePtr>(depthData.data),
@@ -431,7 +435,7 @@ namespace mv3d
                                handle->GetPointcloudFromSource(*input, depthData, p);
 
                                mv_3d_pointcloud_h pcd = &p;
-                               handle->mPointcloudCallback(static_cast<mv_source_h>(mInternalSource),
+                               handle->mPointcloudCallback(static_cast<mv_source_h>(handle->mInternalSource),
                                                pcd,
                                                handle->mPointcloudUserData);
                                auto pPcd = static_cast<std::shared_ptr<open3d::geometry::PointCloud>*>(p.pointcloud);
index fdb9d02..bcc2f5d 100644 (file)
@@ -1,6 +1,6 @@
 Name:        capi-media-vision
 Summary:     Media Vision library for Tizen Native API
-Version:     0.23.27
+Version:     0.23.28
 Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0 and BSD-3-Clause