summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaejeong Kim <backto.kim@samsung.com>2017-03-23 15:12:00 +0900
committerJiyong Min <jiyong.min@samsung.com>2017-06-29 09:44:14 +0900
commitf3a797fe0adf13f9d587bbfcd460bfdc304a7611 (patch)
tree2c6ce7724a6eed3640bcbc59bbe1694c296a3d41
parent54768e415cf0f17c1d0f8906cc2a7c8d48417a15 (diff)
downloadlibmm-imgp-gstcs-accepted/tizen/3.0/common/20170630.144432.tar.gz
libmm-imgp-gstcs-accepted/tizen/3.0/common/20170630.144432.tar.bz2
libmm-imgp-gstcs-accepted/tizen/3.0/common/20170630.144432.zip
=================================== Use license macro in spec file Change-Id: Ib53555179ecce2542d941715e01418bbb67b1fec Svace issue fix. change strncpy to g_strlcpy Change-Id: I8a4701548115d7afada4f4126218d2fded6cba3b Signed-off-by: Jiyong Min <jiyong.min@samsung.com> Change the length of format for strlcpy [Problem] Copying 'RGBA8888' string make crash. (This issue happen after svace issue was fixed) [Solution] Change the length of string to copy Change-Id: I741012cd0763b9c61bbc15fbc9bd307cbfd9d01c Signed-off-by: jiyong min <jiyong.min@samsung.com> fix invalid format argument types for dlog Change-Id: I538566e64fbcc232e439fcf6f2fd5535d64c9432
-rwxr-xr-xgstcs/mm_util_gstcs.c25
-rwxr-xr-xpackaging/libmm-imgp-gstcs.spec6
2 files changed, 16 insertions, 15 deletions
diff --git a/gstcs/mm_util_gstcs.c b/gstcs/mm_util_gstcs.c
index a56ee53..d4d4a66 100755
--- a/gstcs/mm_util_gstcs.c
+++ b/gstcs/mm_util_gstcs.c
@@ -27,6 +27,8 @@
#define MM_UTIL_ROUND_UP_8(num) (((num)+7)&~7)
#define MM_UTIL_ROUND_UP_16(num) (((num)+15)&~15)
+#define SAFE_STRCPY(dst, src, n) g_strlcpy(dst, src, n)
+
static GstFlowReturn
_mm_sink_sample(GstElement * appsink, gpointer user_data)
@@ -214,9 +216,9 @@ _mm_set_image_input_format_s_capabilities(image_format_s* __format) /*_format_la
|| strcmp(__format->format_label, "YV12") == 0
|| strcmp(__format->format_label, "NV12") == 0
|| strcmp(__format->format_label, "UYVY") == 0) {
- strncpy(_format_name, __format->format_label, sizeof(GST_VIDEO_FORMATS_ALL)-1);
+ SAFE_STRCPY(_format_name, __format->format_label, sizeof(_format_name));
} else if (strcmp(__format->format_label, "YUYV") == 0) {
- strncpy(_format_name, "YVYU", sizeof(GST_VIDEO_FORMATS_ALL)-1);
+ SAFE_STRCPY(_format_name, "YVYU", sizeof(_format_name));
}
gstcs_debug("Chosen video format: %s", _format_name);
__format->caps = gst_caps_new_simple("video/x-raw",
@@ -307,9 +309,9 @@ _mm_set_image_output_format_s_capabilities(image_format_s* __format) /*_format_l
|| strcmp(__format->format_label, "YV12") == 0
|| strcmp(__format->format_label, "NV12") == 0
|| strcmp(__format->format_label, "UYVY") == 0) {
- strncpy(_format_name, __format->format_label, sizeof(GST_VIDEO_FORMATS_ALL)-1);
+ SAFE_STRCPY(_format_name, __format->format_label, sizeof(_format_name));
} else if (strcmp(__format->format_label, "YUYV") == 0) {
- strncpy(_format_name, "YVYU", sizeof(GST_VIDEO_FORMATS_ALL)-1);
+ SAFE_STRCPY(_format_name, "YVYU", sizeof(_format_name));
}
gstcs_debug("Chosen video format: %s", _format_name);
__format->caps = gst_caps_new_simple("video/x-raw",
@@ -389,13 +391,13 @@ _mm_set_image_colorspace(image_format_s* __format)
memset(__format->colorspace, 0, IMAGE_FORMAT_LABEL_BUFFER_SIZE);
if ((strcmp(__format->format_label, "I420") == 0) || (strcmp(__format->format_label, "Y42B") == 0) || (strcmp(__format->format_label, "Y444") == 0)
|| (strcmp(__format->format_label, "YV12") == 0) || (strcmp(__format->format_label, "NV12") == 0) || (strcmp(__format->format_label, "UYVY") == 0) || (strcmp(__format->format_label, "YUYV") == 0)) {
- strncpy(__format->colorspace, "YUV", IMAGE_FORMAT_LABEL_BUFFER_SIZE-1);
+ SAFE_STRCPY(__format->colorspace, "YUV", IMAGE_FORMAT_LABEL_BUFFER_SIZE);
} else if ((strcmp(__format->format_label, "RGB888") == 0) || (strcmp(__format->format_label, "BGR888") == 0) || (strcmp(__format->format_label, "RGB565") == 0)) {
- strncpy(__format->colorspace, "RGB", IMAGE_FORMAT_LABEL_BUFFER_SIZE-1);
+ SAFE_STRCPY(__format->colorspace, "RGB", IMAGE_FORMAT_LABEL_BUFFER_SIZE);
} else if ((strcmp(__format->format_label, "ARGB8888") == 0) || (strcmp(__format->format_label, "BGRA8888") == 0) || (strcmp(__format->format_label, "RGBA8888") == 0) || (strcmp(__format->format_label, "ABGR8888") == 0)) {
- strncpy(__format->colorspace, "RGBA", IMAGE_FORMAT_LABEL_BUFFER_SIZE-1);
+ SAFE_STRCPY(__format->colorspace, "RGBA", IMAGE_FORMAT_LABEL_BUFFER_SIZE);
} else if ((strcmp(__format->format_label, "BGRX") == 0)) {
- strncpy(__format->colorspace, "BGRX", IMAGE_FORMAT_LABEL_BUFFER_SIZE-1);
+ SAFE_STRCPY(__format->colorspace, "BGRX", IMAGE_FORMAT_LABEL_BUFFER_SIZE);
} else {
gstcs_error("Check your colorspace format label");
GSTCS_FREE(__format->colorspace);
@@ -468,7 +470,7 @@ _mm_set_input_image_format_s_struct(imgp_info_s* pImgp_info) /* char* __format_l
return NULL;
}
memset(__format->format_label, 0, IMAGE_FORMAT_LABEL_BUFFER_SIZE);
- strncpy(__format->format_label, pImgp_info->input_format_label, strlen(pImgp_info->input_format_label));
+ SAFE_STRCPY(__format->format_label, pImgp_info->input_format_label, IMAGE_FORMAT_LABEL_BUFFER_SIZE);
gstcs_debug("input_format_label: %s\n", pImgp_info->input_format_label);
_mm_set_image_colorspace(__format);
@@ -523,7 +525,7 @@ _mm_set_output_image_format_s_struct(imgp_info_s* pImgp_info, const image_format
return NULL;
}
memset(__format->format_label, 0, IMAGE_FORMAT_LABEL_BUFFER_SIZE);
- strncpy(__format->format_label, pImgp_info->output_format_label, strlen(pImgp_info->output_format_label));
+ SAFE_STRCPY(__format->format_label, pImgp_info->output_format_label, IMAGE_FORMAT_LABEL_BUFFER_SIZE);
_mm_set_image_colorspace(__format);
__format->width = pImgp_info->dst_width;
@@ -606,6 +608,7 @@ _mm_push_buffer_into_pipeline_new(image_format_s *input_format, image_format_s *
if (gst_buf == NULL) {
gstcs_error("buffer is NULL\n");
+ GSTCS_FREE(data);
return GSTCS_ERROR_INVALID_PARAMETER;
}
@@ -710,7 +713,7 @@ _mm_imgp_gstcs_processing(gstreamer_s* pGstreamer_s, unsigned char *src, unsigne
pGstreamer_s->output_buffer = NULL;
return GSTCS_ERROR_INVALID_OPERATION;
}
- gstcs_debug("pGstreamer_s->output_buffer: 0x%2x\n", pGstreamer_s->output_buffer);
+ gstcs_debug("pGstreamer_s->output_buffer: %p\n", pGstreamer_s->output_buffer);
memcpy(dst, mapinfo.data, buffer_size);
pImgp_info->buffer_size = buffer_size;
gst_buffer_unmap(pGstreamer_s->output_buffer, &mapinfo);
diff --git a/packaging/libmm-imgp-gstcs.spec b/packaging/libmm-imgp-gstcs.spec
index 3925591..cd642d0 100755
--- a/packaging/libmm-imgp-gstcs.spec
+++ b/packaging/libmm-imgp-gstcs.spec
@@ -1,7 +1,7 @@
#sbs-git:slp/pkgs/l/libmm-imgp-gstcs libmm-imgp-gstcs 0.1 62b62e6d483557fc5750d1b4986e9a98323f1194
Name: libmm-imgp-gstcs
Summary: Multimedia Framework Utility Library
-Version: 0.12
+Version: 0.14
Release: 16
Group: System/Libraries
License: Apache-2.0
@@ -46,8 +46,6 @@ make %{?jobs:-j%jobs}
%install
rm -rf %{buildroot}
%make_install
-mkdir -p %{buildroot}/usr/share/license
-cp LICENSE.APLv2.0 %{buildroot}/usr/share/license/%{name}
%clean
rm -rf %{buildroot}
@@ -56,7 +54,7 @@ rm -rf %{buildroot}
%postun -p /sbin/ldconfig
%files
-/usr/share/license/%{name}
+%license LICENSE.APLv2.0
%manifest %{name}.manifest
%defattr(-,root,root,-)
%{_libdir}/*.so*