From 681ccc604bad8c06ef2c20fda660031532af74e2 Mon Sep 17 00:00:00 2001 From: Jaechul Lee Date: Mon, 13 Apr 2020 09:54:31 +0900 Subject: [PATCH] Adds checking file existence [Version] 0.12.71 [Issue Type] Bug Change-Id: I3f8450ec6431851cb84e205d9d5b90e30a645859 Signed-off-by: Jaechul Lee --- mm_sound_proxy.c | 7 +++++++ packaging/libmm-sound.spec | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mm_sound_proxy.c b/mm_sound_proxy.c index 8a8d926..f322e28 100644 --- a/mm_sound_proxy.c +++ b/mm_sound_proxy.c @@ -941,6 +941,13 @@ int mm_sound_proxy_play_sound_with_stream_info(const char* filename, int repeat, return MM_ERROR_INVALID_ARGUMENT; } + if (access(filename, F_OK) != 0) { + char str_error[256]; + strerror_r(errno, str_error, sizeof(str_error)); + debug_error("file [%s] doesn't exists : [%s][%d]", filename, str_error, errno); + return MM_ERROR_SOUND_FILE_NOT_FOUND; + } + debug_fenter(); if ((params = g_variant_new("(siisi)", filename, repeat, client_pid, stream_type, stream_id)) == NULL) { diff --git a/packaging/libmm-sound.spec b/packaging/libmm-sound.spec index 48a5086..a9000a3 100644 --- a/packaging/libmm-sound.spec +++ b/packaging/libmm-sound.spec @@ -1,6 +1,6 @@ Name: libmm-sound Summary: MMSound Package contains client lib and sound_server binary -Version: 0.12.70 +Version: 0.12.71 Release: 0 Group: System/Libraries License: Apache-2.0 -- 2.7.4