roi tracker: Adds parameter checking 66/280866/1
authorHyunsoo Park <hance.park@samsung.com>
Tue, 6 Sep 2022 06:03:23 +0000 (15:03 +0900)
committerHyunsoo Park <hance.park@samsung.com>
Tue, 6 Sep 2022 06:04:00 +0000 (15:04 +0900)
[Issue type] Improvement

Change-Id: I3f84bac4a18c395925975d1898d865e58774d355
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 32b3488..d8bba9a 100644 (file)
@@ -113,6 +113,11 @@ int mv_roi_tracker_prepare_open(mv_roi_tracker_h handle, int x, int y, int width
                return MEDIA_VISION_ERROR_INVALID_PARAMETER;
        }
 
+       if( x < 0 || y < 0 || width <= 0 || height <= 0 ) {
+               LOGE("Invalid ROI. Check if roi parameters are less than zero, specially if width and height are equal to zero.");
+               return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+       }
+
        auto pTracker = static_cast<ROITracker *>(handle);
        pTracker->setRoi(x, y, width, height);
 
index ba8863e..b63120d 100644 (file)
@@ -1,6 +1,6 @@
 Name:        capi-media-vision
 Summary:     Media Vision library for Tizen Native API
-Version:     0.23.23
+Version:     0.23.24
 Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0 and BSD-3-Clause