From: Gilbok Lee Date: Thu, 14 Sep 2017 10:50:54 +0000 (+0900) Subject: Fix build warning and fix svace issue X-Git-Tag: accepted/tizen/unified/20170920.065403^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da4050af084cb2005f3c3514dea577347b2e57c6;p=platform%2Fupstream%2Fgst-plugins-base.git Fix build warning and fix svace issue Change-Id: I30f87724071be5a497313ba89424aabc0cb539e7 --- diff --git a/gst-libs/gst/video/video-converter.c b/gst-libs/gst/video/video-converter.c index 4b58285..2e4e7cf 100644 --- a/gst-libs/gst/video/video-converter.c +++ b/gst-libs/gst/video/video-converter.c @@ -3901,8 +3901,8 @@ convert_scale_planes (GstVideoConverter * convert, } static void -convert_I420_SN12 (GstVideoConverter * convert, GstVideoFrame * src, - const GstVideoFrame *dest ) +convert_I420_SN12 (GstVideoConverter * convert, const GstVideoFrame * src, + GstVideoFrame * dest ) { MMVideoBuffer *mm_video_buf = NULL; GstMemory *mem = NULL; @@ -4038,6 +4038,11 @@ get_scale_format (GstVideoFormat format, gint plane) res = format; g_assert_not_reached (); break; +#ifdef TIZEN_FEATURE_VIDEO_MODIFICATION + default: + break; +#endif + } return res; } diff --git a/gst-libs/gst/video/video-info.c b/gst-libs/gst/video/video-info.c index 6098c6b..4b703ae 100644 --- a/gst-libs/gst/video/video-info.c +++ b/gst-libs/gst/video/video-info.c @@ -880,6 +880,9 @@ fill_planes (GstVideoInfo * info) case GST_VIDEO_FORMAT_ENCODED: break; case GST_VIDEO_FORMAT_UNKNOWN: +#ifdef TIZEN_FEATURE_VIDEO_MODIFICATION + default: +#endif GST_ERROR ("invalid format"); g_warning ("invalid format"); break; diff --git a/gst/subparse/samiparse.c b/gst/subparse/samiparse.c index 0fa3841..b165b9b 100644 --- a/gst/subparse/samiparse.c +++ b/gst/subparse/samiparse.c @@ -899,6 +899,7 @@ static void handle_p (GstSamiContext * sctx, const gchar ** atts) { int i; + const int str_size = 128; if (atts != NULL) { for (i = 0; (atts[i] != NULL); i += 2) { @@ -911,10 +912,10 @@ handle_p (GstSamiContext * sctx, const gchar ** atts) && (sctx->time1 == sctx->time2)) sctx->language_changed = TRUE; else if (!sctx->current_language) - sctx->current_language = (gchar*) malloc (128); + sctx->current_language = (gchar*) malloc (str_size); if (key && !g_ascii_strcasecmp ("class", key) && value) { - strcpy (sctx->current_language, value); + strncpy (sctx->current_language, value, str_size - 1); if (sctx->desired_language == NULL) { sctx->desired_language = g_strdup(value); GST_LOG("no language list was found and desired lang was set to %s", sctx->desired_language); @@ -959,10 +960,10 @@ handle_start_language_list (GstSamiContext * sctx, const gchar ** atts) new = g_new0 (GstLangStruct, 1); new->language_code = (gchar*) malloc (strlen(value) + 1); if (new->language_code && value) - strcpy (new->language_code, value); + g_strlcpy (new->language_code, value, strlen(value) + 1); new->language_key = (gchar*) malloc (strlen(key) + 1); if (new->language_key && key) - strcpy (new->language_key, key); + g_strlcpy (new->language_key, key, strlen(key) + 1); sctx->lang_list = g_list_append (sctx->lang_list, new); temp = g_list_nth_data (sctx->lang_list, i); if (sctx->desired_language == NULL && key){ @@ -1008,9 +1009,12 @@ handle_start_element (HtmlContext * ctx, const gchar * name, } else if (!g_ascii_strcasecmp ("i", name)) { #ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION if (sctx->current_language && sctx->desired_language && - !strcmp(sctx->current_language, sctx->desired_language)) + !strcmp(sctx->current_language, sctx->desired_language)) { #endif g_string_append (sctx->buf, ""); +#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION + } +#endif sami_context_push_state (sctx, ITALIC_TAG); } else if (!g_ascii_strcasecmp ("p", name)) { #ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION diff --git a/gst/videoconvert/gsttbmbufferpool.c b/gst/videoconvert/gsttbmbufferpool.c index f0d1955..ccba852 100644 --- a/gst/videoconvert/gsttbmbufferpool.c +++ b/gst/videoconvert/gsttbmbufferpool.c @@ -2,6 +2,8 @@ #include "gsttbmbufferpool.h" #include +static GQuark gst_mm_buffer_data_quark = 0; + int new_calc_plane(int width, int height) { int mbX, mbY; diff --git a/gst/videoconvert/gsttbmbufferpool.h b/gst/videoconvert/gsttbmbufferpool.h index f6f113a..675b0a0 100644 --- a/gst/videoconvert/gsttbmbufferpool.h +++ b/gst/videoconvert/gsttbmbufferpool.h @@ -46,10 +46,6 @@ struct _GstMMBuffer }; #define GST_MM_VIDEO_MEMORY_TYPE "mmvideobuffer" - - -static GQuark gst_mm_buffer_data_quark = 0; - #define GST_TYPE_MM_BUFFER_POOL \ (gst_mm_buffer_pool_get_type() #define GST_MM_BUFFER_POOL(obj) \ diff --git a/gst/videoconvert/gstvideoconvert.c b/gst/videoconvert/gstvideoconvert.c index 88224d8..fd69405 100644 --- a/gst/videoconvert/gstvideoconvert.c +++ b/gst/videoconvert/gstvideoconvert.c @@ -760,7 +760,7 @@ gst_video_convert_decide_allocation (GstBaseTransform * trans, gst_query_parse_allocation (query, &caps, NULL); if (caps) { - vc->tbm_buffer_pool = gst_mm_buffer_pool_new(trans); + vc->tbm_buffer_pool = gst_mm_buffer_pool_new(GST_ELEMENT_CAST(trans)); GST_DEBUG("[%s]CREATING VIDEO_BUFFER_POOL",__FUNCTION__); } @@ -805,7 +805,6 @@ static GstFlowReturn gst_video_convert_prepare_output_buffer (GstBaseTransform * trans, GstBuffer *input, GstBuffer **outbuf) { - GstBuffer *out_buffer = NULL; GstVideoConvert *vc = NULL; GstVideoFilter *filter = GST_VIDEO_FILTER_CAST (trans);