int ret = MS_MEDIA_ERR_NONE;
sqlite3 *db_handle = (sqlite3 *)handle;
media_svc_media_type_e media_type;
+ char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1] = {0, };
media_svc_retvm_if(db_handle == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "Handle is NULL");
media_svc_retvm_if(!STRING_VALID(storage_id), MS_MEDIA_ERR_INVALID_PARAMETER, "storage_id is NULL");
return ret;
/* Initialize thumbnail information to remake thumbnail. */
- char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1];
ret = _media_svc_get_thumbnail_path_by_path(db_handle, path, thumb_path);
- if (ret != MS_MEDIA_ERR_NONE) {
+ if (ret != MS_MEDIA_ERR_NONE && ret != MS_MEDIA_ERR_DB_NO_RECORD) {
_media_svc_destroy_content_info(&content_info);
return ret;
}
- if (g_file_test(thumb_path, G_FILE_TEST_EXISTS)) {
- ret = _media_svc_remove_file(thumb_path);
- if (ret != MS_MEDIA_ERR_NONE)
- media_svc_error("_media_svc_remove_file failed : %s", thumb_path);
- }
+ if (STRING_VALID(thumb_path)) {
+ if (g_file_test(thumb_path, G_FILE_TEST_EXISTS)) {
+ ret = _media_svc_remove_file(thumb_path);
+ if (ret != MS_MEDIA_ERR_NONE)
+ media_svc_error("_media_svc_remove_file failed : %s", thumb_path);
+ }
- ret = _media_svc_update_thumbnail_path(path, NULL, uid);
- if (ret != MS_MEDIA_ERR_NONE) {
- _media_svc_destroy_content_info(&content_info);
- return ret;
+ ret = _media_svc_update_thumbnail_path(path, NULL, uid);
+ if (ret != MS_MEDIA_ERR_NONE) {
+ _media_svc_destroy_content_info(&content_info);
+ return ret;
+ }
}
/* Get notification info */
/* Extracting thumbnail */
if (content_info.thumbnail_path == NULL) {
if (media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE || media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO) {
- char thumb_path[MEDIA_SVC_PATHNAME_SIZE + 1] = {0, };
+ memset(thumb_path, 0, sizeof(thumb_path));
ret = _media_svc_request_thumbnail(content_info.path, thumb_path, sizeof(thumb_path), uid);
if (ret == MS_MEDIA_ERR_NONE)