summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packaging/libmedia-thumbnail.spec2
-rwxr-xr-xsrc/ipc/media-thumb-ipc.c21
2 files changed, 22 insertions, 1 deletions
diff --git a/packaging/libmedia-thumbnail.spec b/packaging/libmedia-thumbnail.spec
index a435c73..3153e17 100644
--- a/packaging/libmedia-thumbnail.spec
+++ b/packaging/libmedia-thumbnail.spec
@@ -1,6 +1,6 @@
Name: libmedia-thumbnail
Summary: Media thumbnail service library for multimedia applications
-Version: 0.1.88
+Version: 0.1.89
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0 and public domain
diff --git a/src/ipc/media-thumb-ipc.c b/src/ipc/media-thumb-ipc.c
index 5d7028f..773eb61 100755
--- a/src/ipc/media-thumb-ipc.c
+++ b/src/ipc/media-thumb-ipc.c
@@ -770,9 +770,20 @@ int _media_thumb_send_request()
thumb_stderror("connect");
g_io_channel_shutdown(channel, TRUE, NULL);
g_io_channel_unref(channel);
+ ms_ipc_delete_client_socket(&sock_info);
return MS_MEDIA_ERR_SOCKET_CONN;
}
+
req_manager = (thumbReq *)g_queue_pop_head(g_manage_queue);
+
+ if (req_manager == NULL) {
+ thumb_err("queue pop fail");
+ g_io_channel_shutdown(channel, TRUE, NULL);
+ g_io_channel_unref(channel);
+ ms_ipc_delete_client_socket(&sock_info);
+ return MS_MEDIA_ERR_INVALID_PARAMETER;
+ }
+
GSource *source = NULL;
source = g_io_create_watch(channel, G_IO_IN);
g_source_set_callback(source, (GSourceFunc)_media_thumb_write_socket, req_manager->userData, NULL);
@@ -873,10 +884,20 @@ int _media_thumb_raw_data_send_request()
thumb_stderror("connect error");
g_io_channel_shutdown(channel, TRUE, NULL);
g_io_channel_unref(channel);
+ ms_ipc_delete_client_socket(&sock_info);
return MS_MEDIA_ERR_SOCKET_CONN;
}
req_manager = (thumbRawReq *)g_queue_pop_head(g_manage_raw_queue);
+
+ if (req_manager == NULL) {
+ thumb_err("queue pop fail");
+ g_io_channel_shutdown(channel, TRUE, NULL);
+ g_io_channel_unref(channel);
+ ms_ipc_delete_client_socket(&sock_info);
+ return MS_MEDIA_ERR_INVALID_PARAMETER;
+ }
+
GSource *source = NULL;
source = g_io_create_watch(channel, G_IO_IN);
g_source_set_callback(source, (GSourceFunc)_media_thumb_raw_data_write_socket, req_manager->userData, NULL);