fix prevent bug. 58/56058/1 accepted/tizen/mobile/20160104.054744 accepted/tizen/tv/20160104.054804 accepted/tizen/wearable/20160104.054825 submit/tizen/20160104.042629
authorMinje Ahn <minje.ahn@samsung.com>
Mon, 4 Jan 2016 04:13:53 +0000 (13:13 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Mon, 4 Jan 2016 04:13:53 +0000 (13:13 +0900)
Change-Id: Ic1ef8a43d36a6b3bf3aba19bc9737298433130e0
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
packaging/libmedia-thumbnail.spec
src/ipc/media-thumb-ipc.c

index a435c73..3153e17 100644 (file)
@@ -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
index 5d7028f..773eb61 100755 (executable)
@@ -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);