summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-07-03 11:26:49 (GMT)
committerSung-jae Park <nicesj.park@samsung.com>2013-07-03 11:26:49 (GMT)
commitadaf3872db5e6765879ca96f95e471ba0fac695f (patch)
tree98c9533d9fabad1b8785edfe8e2b9a372b03960e
parent89bf804c60a46a102df2b59fdf59d7b88b689105 (diff)
downloaddata-provider-master-adaf3872db5e6765879ca96f95e471ba0fac695f.zip
data-provider-master-adaf3872db5e6765879ca96f95e471ba0fac695f.tar.gz
data-provider-master-adaf3872db5e6765879ca96f95e471ba0fac695f.tar.bz2
Update acquire/release pixmap operation & fix crash bug
while terminating service threads, in case of the "ptr" is not initialized (at the first time), calling a "free" function can be crashed. Change-Id: If261e1ab4f35ac72d64ccb9dcba127e1cdc8e083
-rw-r--r--include/fb.h3
-rw-r--r--packaging/data-provider-master.spec2
-rw-r--r--src/fb.c5
-rw-r--r--src/server.c44
-rw-r--r--src/service_common.c2
5 files changed, 49 insertions, 7 deletions
diff --git a/include/fb.h b/include/fb.h
index bf6d224..0061bc6 100644
--- a/include/fb.h
+++ b/include/fb.h
@@ -16,6 +16,7 @@
struct fb_info;
struct inst_info;
+struct buffer_info;
extern int fb_init(void);
extern int fb_fini(void);
@@ -34,5 +35,5 @@ extern int fb_resize(struct fb_info *info, int w, int h);
*/
extern void *fb_pixmap_render_pre(struct fb_info *info);
extern int fb_pixmap_render_post(struct fb_info *info);
-
+extern struct buffer_info *fb_buffer_info(struct fb_info *info);
/* End of a file */
diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec
index fd1283f..a442560 100644
--- a/packaging/data-provider-master.spec
+++ b/packaging/data-provider-master.spec
@@ -1,6 +1,6 @@
Name: data-provider-master
Summary: Master service provider for liveboxes.
-Version: 0.24.15
+Version: 0.24.16
Release: 1
Group: HomeTF/Livebox
License: Flora License
diff --git a/src/fb.c b/src/fb.c
index 1056dc5..d4db09f 100644
--- a/src/fb.c
+++ b/src/fb.c
@@ -276,4 +276,9 @@ HAPI int fb_pixmap_render_post(struct fb_info *info)
return buffer_handler_pixmap_release_buffer(canvas);
}
+HAPI struct buffer_info *fb_buffer_info(struct fb_info *info)
+{
+ return info->buffer;
+}
+
/* End of a file */
diff --git a/src/server.c b/src/server.c
index 5725aac..1934462 100644
--- a/src/server.c
+++ b/src/server.c
@@ -4331,8 +4331,26 @@ static struct packet *client_lb_acquire_pixmap(pid_t pid, int handle, const stru
buffer = instance_lb_buffer(inst);
if (!buffer) {
- ErrPrint("Unable to get LB buffer: %s\n", id);
- goto out;
+ struct script_info *script_info;
+ struct fb_info *fb_info;
+
+ script_info = instance_lb_script(inst);
+ if (!script_info) {
+ ErrPrint("Unable to get LB buffer: %s\n", id);
+ goto out;
+ }
+
+ fb_info = script_handler_fb(script_info);
+ if (!fb_info) {
+ ErrPrint("Unable to get fb_info: %s\n", id);
+ goto out;
+ }
+
+ buffer = fb_buffer_info(fb_info);
+ if (!buffer) {
+ ErrPrint("Unable to get buffer_info: %s\n", id);
+ goto out;
+ }
}
buf_ptr = buffer_handler_pixmap_ref(buffer);
@@ -4427,8 +4445,26 @@ static struct packet *client_pd_acquire_pixmap(pid_t pid, int handle, const stru
buffer = instance_pd_buffer(inst);
if (!buffer) {
- ErrPrint("Unable to get PD buffer (%s)\n", id);
- goto out;
+ struct script_info *script_info;
+ struct fb_info *fb_info;
+
+ script_info = instance_pd_script(inst);
+ if (!script_info) {
+ ErrPrint("Unable to get LB buffer: %s\n", id);
+ goto out;
+ }
+
+ fb_info = script_handler_fb(script_info);
+ if (!fb_info) {
+ ErrPrint("Unable to get fb_info: %s\n", id);
+ goto out;
+ }
+
+ buffer = fb_buffer_info(fb_info);
+ if (!buffer) {
+ ErrPrint("Unable to get buffer_info: %s\n", id);
+ goto out;
+ }
}
buf_ptr = buffer_handler_pixmap_ref(buffer);
diff --git a/src/service_common.c b/src/service_common.c
index 1895d8c..b9116a4 100644
--- a/src/service_common.c
+++ b/src/service_common.c
@@ -104,7 +104,7 @@ static void *client_packet_pump_main(void *data)
struct service_context *svc_ctx = tcb->svc_ctx;
struct packet *packet;
fd_set set;
- char *ptr;
+ char *ptr = NULL;
int size;
int packet_offset;
int recv_offset;