From: Kwanghoon Son Date: Thu, 2 Nov 2023 05:55:35 +0000 (+0900) Subject: Fix svace, coverity, lint X-Git-Tag: accepted/tizen/8.0/unified/20231107.094921^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e00bae635ae920f3470b46464607ec1fb4de972;p=platform%2Fcore%2Fmultimedia%2Fvision-source-v4l2.git Fix svace, coverity, lint [Version] 1.0.1 Change-Id: I63d1f9b785c62705409f66993b99ab87fe1804a1 Signed-off-by: Kwanghoon Son --- 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; }