return GST_AUTOPLUG_SELECT_TRY;
}
memset(handle->property->audiodecodename, 0, ENC_BUFFER_SIZE);
- strncpy(handle->property->audiodecodename, feature_name, ENC_BUFFER_SIZE - 1);
- handle->property->audiodecodename[ENC_BUFFER_SIZE] = '\0';
+ g_strlcpy(handle->property->audiodecodename, feature_name, ENC_BUFFER_SIZE);
debug_log("[audio decode name %s : %s]", caps_str, handle->property->audiodecodename);
}
return GST_AUTOPLUG_SELECT_TRY;
}
memset(handle->property->videodecodename, 0, ENC_BUFFER_SIZE);
- strncpy(handle->property->videodecodename, feature_name, ENC_BUFFER_SIZE - 1);
- handle->property->videodecodename[ENC_BUFFER_SIZE] = '\0';
+ g_strlcpy(handle->property->videodecodename, feature_name, ENC_BUFFER_SIZE);
debug_log("[video decode name %s : %s]", caps_str, handle->property->videodecodename);
}
}
memset(handle->param->outputfile, 0, BUFFER_SIZE);
- strncpy(handle->param->outputfile, param->outputfile, BUFFER_SIZE - 1);
- handle->param->outputfile[BUFFER_SIZE] = '\0';
+ g_strlcpy(handle->param->outputfile, param->outputfile, BUFFER_SIZE);
handle->param->seeking = param->seeking;
handle->param->async_done = FALSE;
debug_log("mime: %s", handle->property->mime);
const gchar *format = gst_structure_get_string(_str, "format");
- strncpy(handle->property->format, format, sizeof(handle->property->format));
- handle->property->format[sizeof(handle->property->format) - 1] = '\0';
+ g_strlcpy(handle->property->format, format, sizeof(handle->property->format));
switch (gst_video_format_from_string(handle->property->format)) {
case GST_VIDEO_FORMAT_I420:
handle->property->sourcefile = malloc(sizeof(char) * BUFFER_SIZE);
if (handle->property->sourcefile) {
memset(handle->property->sourcefile, 0, BUFFER_SIZE);
- strncpy(handle->property->sourcefile, in_Filename, strlen(in_Filename));
+ g_strlcpy(handle->property->sourcefile, in_Filename, BUFFER_SIZE);
debug_log("%s", handle->property->sourcefile);
} else {
debug_error("[ERROR] malloc fail of sourcefile");
return MM_ERROR_TRANSCODE_NO_FREE_SPACE;
}
memset(param->outputfile, 0, BUFFER_SIZE);
- strncpy(param->outputfile, out_Filename, BUFFER_SIZE - 1);
- param->outputfile[BUFFER_SIZE] = '\0';
+ g_strlcpy(param->outputfile, out_Filename, BUFFER_SIZE);
debug_log("%s(%d)", param->outputfile, strlen(out_Filename));
} else {
debug_error("out_Filename error");