summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorVasiliy Ulyanov <v.ulyanov@samsung.com>2014-10-21 18:01:06 +0400
committerVasiliy Ulyanov <v.ulyanov@samsung.com>2014-11-05 10:12:14 +0300
commit19d0ca4e299be52293f388c816316be228a8006e (patch)
treedf670ec7fcae095a9f2c61028880fc4a7b0e872e /hw
parent74a46818f05112884b668827e137cdcff1045814 (diff)
downloadqemu-19d0ca4e299be52293f388c816316be228a8006e.tar.gz
qemu-19d0ca4e299be52293f388c816316be228a8006e.tar.bz2
qemu-19d0ca4e299be52293f388c816316be228a8006e.zip
VIGS: add NULL checks when screen capturing
- root_sfc may be NULL - pixels buffer may be NULL Change-Id: Icc7a4d2ca486bc08273da3158b823e9c4c090592 Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/vigs/vigs_onscreen_server.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/vigs/vigs_onscreen_server.c b/hw/vigs/vigs_onscreen_server.c
index 4c51c17678..8a06219b26 100644
--- a/hw/vigs/vigs_onscreen_server.c
+++ b/hw/vigs/vigs_onscreen_server.c
@@ -43,12 +43,15 @@ static void vigs_onscreen_server_capture_work(struct work_queue_item *wq_item)
{
struct vigs_capture_work_item *item = (struct vigs_capture_work_item*)wq_item;
struct vigs_onscreen_server *server = item->server;
+ struct vigs_surface *root_sfc = server->base.root_sfc;
+ bool captured = false;
uint32_t width, height;
- bool captured;
void *pixels;
pixels = vigs_server_get_capture_buffer(&server->base, &width, &height);
- captured = server->base.backend->capture(server->base.root_sfc, pixels);
+ if (root_sfc && pixels) {
+ captured = server->base.backend->capture(root_sfc, pixels);
+ }
server->capture_ops->process_captured(captured, pixels, width, height);
g_free(item);