Fix svace, coverity, lint accepted/tizen_8.0_unified accepted/tizen_unified_dev accepted/tizen_unified_riscv tizen_8.0 accepted/tizen/8.0/unified/20231107.094921 accepted/tizen/unified/20231221.165357 accepted/tizen/unified/dev/20240620.005549 accepted/tizen/unified/riscv/20231226.211427
authorKwanghoon Son <k.son@samsung.com>
Thu, 2 Nov 2023 05:55:35 +0000 (14:55 +0900)
committerKwanghoon Son <k.son@samsung.com>
Thu, 2 Nov 2023 06:01:44 +0000 (15:01 +0900)
[Version] 1.0.1

Change-Id: I63d1f9b785c62705409f66993b99ab87fe1804a1
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
execute_format.sh [new file with mode: 0755]
packaging/vision-source-v4l2.spec
src/vision_source_v4l2.cpp

diff --git a/execute_format.sh b/execute_format.sh
new file mode 100755 (executable)
index 0000000..bd0fd4b
--- /dev/null
@@ -0,0 +1 @@
+find . -iname *.h -o -iname *.hpp -o -iname *.cpp -o -iname *.c | xargs clang-format-9 -i
\ No newline at end of file
index 2ecbb7a..702e777 100644 (file)
@@ -3,7 +3,7 @@
 
 Name:        vision-source-v4l2
 Summary:     vision source-v4l2
-Version:     1.0.0
+Version:     1.0.1
 Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0
index 606f4a0..9d7e075 100644 (file)
@@ -410,6 +410,7 @@ static int __vision_source_list_devices(vision_source_v4l2_s *vs_handle)
        for (size_t i = 0; i < dev_count; i++) {
                vs_handle->dev_info[i].index = i;
                strncpy(vs_handle->dev_info[i].name, dev_name[i].c_str(), DEVICE_NAME_LENGTH_MAX);
+               vs_handle->dev_info[i].name[DEVICE_NAME_LENGTH_MAX - 1] = '\0';
                vs_handle->fmt[i] = (media_format_h *) calloc(dev_fmt_list[i].size(), sizeof(media_format_h));
                if (!vs_handle->fmt[i]) {
                        return VISION_SOURCE_ERROR_OUT_OF_MEMORY;
@@ -656,7 +657,7 @@ int vision_source_init(vision_source_h *handle)
 
        int ret = __vision_source_list_devices(v4l2_handle);
        if (ret != VISION_SOURCE_ERROR_NONE) {
-               free(v4l2_handle);
+               delete v4l2_handle;
                LOGE("get device info failed");
                return ret;
        }