Fix Svace issues 20/125420/3 accepted/tizen/unified/20170420.155048 submit/tizen/20170420.053325
authorGilbok Lee <gilbok.lee@samsung.com>
Mon, 17 Apr 2017 08:13:55 +0000 (17:13 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Mon, 17 Apr 2017 08:38:45 +0000 (17:38 +0900)
[Version] 0.10.4
[Profile] Mobile, TV
[Issue Type] Fix Svace issue

Change-Id: I7e0e1c31e992c366aae1550ed7be2532e3b26dff

packaging/libmm-transcode.spec
transcode/include/mm_transcode.h
transcode/mm_transcode_seek.c

index 6f8747d..03f5d0e 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-transcode
 Summary:    Multimedia Framework Video Transcode Library
-Version:    0.10.3
+Version:    0.10.4
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index b710b2e..740875b 100644 (file)
@@ -222,7 +222,6 @@ mm_transcode_get_supported_video_encoder(mm_transcode_support_type_callback type
 int
 mm_transcode_get_supported_audio_encoder(mm_transcode_support_type_callback type_callback, void *user_param);
 
-
 #ifdef __cplusplus__
 };
 #endif
index c3e0c72..26d1788 100755 (executable)
@@ -195,7 +195,8 @@ GstAutoplugSelectResult _mm_cb_decode_bin_autoplug_select(GstElement *element, G
                        return GST_AUTOPLUG_SELECT_TRY;
                }
                memset(handle->property->audiodecodename, 0, ENC_BUFFER_SIZE);
-               strncpy(handle->property->audiodecodename, feature_name, strlen(feature_name));
+               strncpy(handle->property->audiodecodename, feature_name, ENC_BUFFER_SIZE - 1);
+               handle->property->audiodecodename[ENC_BUFFER_SIZE] = '\0';
                debug_log("[audio decode name %s : %s]", caps_str, handle->property->audiodecodename);
        }
 
@@ -211,7 +212,8 @@ GstAutoplugSelectResult _mm_cb_decode_bin_autoplug_select(GstElement *element, G
                        return GST_AUTOPLUG_SELECT_TRY;
                }
                memset(handle->property->videodecodename, 0, ENC_BUFFER_SIZE);
-               strncpy(handle->property->videodecodename, feature_name, strlen(feature_name));
+               strncpy(handle->property->videodecodename, feature_name, ENC_BUFFER_SIZE - 1);
+               handle->property->videodecodename[ENC_BUFFER_SIZE] = '\0';
                debug_log("[video decode name %s : %s]", caps_str, handle->property->videodecodename);
        }
 
@@ -652,7 +654,8 @@ static int _mm_transcode_exec(handle_s *handle, handle_param_s *param)
                }
 
                memset(handle->param->outputfile, 0, BUFFER_SIZE);
-               strncpy(handle->param->outputfile, param->outputfile, strlen(param->outputfile));
+               strncpy(handle->param->outputfile, param->outputfile, BUFFER_SIZE - 1);
+               handle->param->outputfile[BUFFER_SIZE] = '\0';
 
                handle->param->seeking = param->seeking;
                handle->param->async_done = FALSE;
@@ -1006,7 +1009,8 @@ int _mm_transcode_set_handle_parameter(handle_param_s *param, unsigned int resol
                        return MM_ERROR_TRANSCODE_NO_FREE_SPACE;
                }
                memset(param->outputfile, 0, BUFFER_SIZE);
-               strncpy(param->outputfile, out_Filename, strlen(out_Filename));
+               strncpy(param->outputfile, out_Filename, BUFFER_SIZE - 1);
+               param->outputfile[BUFFER_SIZE] = '\0';
                debug_log("%s(%d)", param->outputfile, strlen(out_Filename));
        } else {
                debug_error("out_Filename error");