summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2019-05-14 11:36:55 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2019-05-14 18:10:55 +0900
commitadaa212f708931f0278a34b2aa6ca2cce07cecb0 (patch)
treebec7d19203f18b94f685acc5860202782db116d8
parentfb82c4e35aa867fab81241ffb614add4361ff5ed (diff)
downloadcamera-adaa212f708931f0278a34b2aa6ca2cce07cecb0.tar.gz
camera-adaa212f708931f0278a34b2aa6ca2cce07cecb0.tar.bz2
camera-adaa212f708931f0278a34b2aa6ca2cce07cecb0.zip
Skip to send SERVER_DISCONNECTED error message if handle is not created.submit/tizen/20190531.021454accepted/tizen/unified/20190603.095156
- The error message could not be delivered to application, and it will cause crash when it's called in idle state. [Version] 0.4.24 [Profile] Common [Issue Type] Bug fix Change-Id: Ib4681ca43c895e74742a19a57866e2080058f0bc Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r--packaging/capi-media-camera.spec2
-rw-r--r--src/camera.c14
2 files changed, 10 insertions, 6 deletions
diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec
index 0d54446..182cf1e 100644
--- a/packaging/capi-media-camera.spec
+++ b/packaging/capi-media-camera.spec
@@ -1,6 +1,6 @@
Name: capi-media-camera
Summary: A Camera API
-Version: 0.4.23
+Version: 0.4.24
Release: 0
Group: Multimedia/API
License: Apache-2.0
diff --git a/src/camera.c b/src/camera.c
index eb1124e..4e34fd3 100644
--- a/src/camera.c
+++ b/src/camera.c
@@ -1656,7 +1656,7 @@ IDLE_EVENT_CALLBACK_DONE:
return FALSE;
}
-static void *_camera_msg_handler_func(gpointer data)
+static gpointer _camera_msg_handler_func(gpointer data)
{
int api = 0;
int type = 0;
@@ -2013,7 +2013,7 @@ static void __camera_process_msg(camera_cb_info_s *cb_info, char *msg, int *tfd)
}
-static void *_camera_msg_recv_func(gpointer data)
+static gpointer _camera_msg_recv_func(gpointer data)
{
int i = 0;
int recv_length = 0;
@@ -2058,9 +2058,14 @@ static void *_camera_msg_recv_func(gpointer data)
if (!cb_info->is_server_connected) {
char *error_msg = NULL;
+ if (cb_info->bufmgr == NULL) {
+ LOGE("No need to send error(handle is not created)");
+ return NULL;
+ }
+
if (cb_info->fd < 0) {
LOGE("fd is closed in client side");
- goto CB_HANDLER_EXIT;
+ return NULL;
}
/* send error msg for server disconnection */
@@ -2071,7 +2076,7 @@ static void *_camera_msg_recv_func(gpointer data)
if (!error_msg) {
LOGE("error_msg failed");
- goto CB_HANDLER_EXIT;
+ return NULL;
}
__camera_add_msg_to_queue(cb_info,
@@ -2087,7 +2092,6 @@ static void *_camera_msg_recv_func(gpointer data)
LOGE("add error msg for service disconnection done");
}
-CB_HANDLER_EXIT:
return NULL;
}