roi_tracker: sets to use default tracker type 19/282219/13 submit/tizen/20221004.074305
authorHyunsoo Park <hance.park@samsung.com>
Wed, 28 Sep 2022 10:45:46 +0000 (19:45 +0900)
committerHyunsoo Park <hance.park@samsung.com>
Tue, 4 Oct 2022 06:28:50 +0000 (15:28 +0900)
[Issue type] : bug fix
[Version]: 0.23.33-0
- From this patch, tracker type is checked for error handling.
If it has wrong setting, default type would be set.

Change-Id: I92935555fcfbfc14a970290b54f79fb3f6520a68
Signed-off-by: Hyunsoo Park <hance.park@samsung.com>
mv_roi_tracker/roi_tracker/src/mv_roi_tracker_open.cpp
packaging/capi-media-vision.spec

index d8bba9a..78499ad 100644 (file)
@@ -92,12 +92,17 @@ int mv_roi_tracker_configure_engine_open(mv_roi_tracker_h handle, mv_engine_conf
                return MEDIA_VISION_ERROR_INVALID_PARAMETER;
        }
 
+       auto pTracker = static_cast<ROITracker *>(handle);
        int tracker_type;
        if (mv_engine_config_get_int_attribute(engine_config, MV_ROI_TRACKER_TYPE, &tracker_type) !=
                MEDIA_VISION_ERROR_NONE)
                return MEDIA_VISION_ERROR_INVALID_OPERATION;
 
-       auto pTracker = static_cast<ROITracker *>(handle);
+       if (tracker_type <= MV_ROI_TRACKER_TYPE_NONE || tracker_type > MV_ROI_TRACKER_TYPE_SPEED) {
+               LOGE("Invalid tracker type. Use default tracker type.(MV_ROI_TRACKER_TYPE_BALANCE)");
+               return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+       }
+
        pTracker->setType(static_cast<mv_roi_tracker_type_e>(tracker_type));
 
        LOGI("LEAVE");
index 54de6e6..a08c8bb 100644 (file)
@@ -1,6 +1,6 @@
 Name:        capi-media-vision
 Summary:     Media Vision library for Tizen Native API
-Version:     0.23.32
+Version:     0.23.33
 Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0 and BSD-3-Clause