diff options
author | Kwanghoon Son <k.son@samsung.com> | 2023-11-02 14:55:35 +0900 |
---|---|---|
committer | Kwanghoon Son <k.son@samsung.com> | 2023-11-02 15:01:44 +0900 |
commit | 2e00bae635ae920f3470b46464607ec1fb4de972 (patch) | |
tree | 6046d172f6854e86a2d9f220f51d7e0063ef0ea6 | |
parent | 1e73a39953db71878bf87b92f7c469aa2d095247 (diff) | |
download | vision-source-v4l2-accepted/tizen_8.0_unified.tar.gz vision-source-v4l2-accepted/tizen_8.0_unified.tar.bz2 vision-source-v4l2-accepted/tizen_8.0_unified.zip |
Fix svace, coverity, lintaccepted/tizen/unified/riscv/20231226.211427accepted/tizen/unified/dev/20240620.005549accepted/tizen/unified/20231221.165357accepted/tizen/8.0/unified/20231107.094921tizen_8.0accepted/tizen_unified_riscvaccepted/tizen_unified_devaccepted/tizen_8.0_unified
[Version] 1.0.1
Change-Id: I63d1f9b785c62705409f66993b99ab87fe1804a1
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
-rwxr-xr-x | execute_format.sh | 1 | ||||
-rw-r--r-- | packaging/vision-source-v4l2.spec | 2 | ||||
-rw-r--r-- | src/vision_source_v4l2.cpp | 3 |
3 files changed, 4 insertions, 2 deletions
diff --git a/execute_format.sh b/execute_format.sh new file mode 100755 index 0000000..bd0fd4b --- /dev/null +++ b/execute_format.sh @@ -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 diff --git a/packaging/vision-source-v4l2.spec b/packaging/vision-source-v4l2.spec index 2ecbb7a..702e777 100644 --- a/packaging/vision-source-v4l2.spec +++ b/packaging/vision-source-v4l2.spec @@ -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 diff --git a/src/vision_source_v4l2.cpp b/src/vision_source_v4l2.cpp index 606f4a0..9d7e075 100644 --- a/src/vision_source_v4l2.cpp +++ b/src/vision_source_v4l2.cpp @@ -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; } |