summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/extn
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-01-25 15:58:16 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-01-25 16:02:49 +0900
commit4d4e6fd4b12545de9e0c9ade58566cd8f2802861 (patch)
tree98bb39adfdf2257cddf65027f5773cbb2ddea9c9 /src/modules/ecore_evas/engines/extn
parentcca830832a9b68757eb83da77aac0294761623b3 (diff)
ecore_evas_extn: Add safety checks, fixing a crash in elm_test
See T2835 (my crash was different from the one reported). The buffer may be initialized after the first render_pre, due to whatever timing issue. Check in elm_test "Window Socket" and then open several "Window Plug". @fix
Diffstat (limited to 'src/modules/ecore_evas/engines/extn')
-rw-r--r--src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c b/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c
index 28ffcc31f9..8f28654a96 100644
--- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c
+++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c
@@ -118,6 +118,7 @@ _extnbuf_data_get(Extnbuf *b, int *w, int *h, int *stride)
118void * 118void *
119_extnbuf_lock(Extnbuf *b, int *w, int *h, int *stride) 119_extnbuf_lock(Extnbuf *b, int *w, int *h, int *stride)
120{ 120{
121 if (!b) return NULL;
121 if (!b->have_lock) 122 if (!b->have_lock)
122 { 123 {
123 if (b->lockfd >= 0) 124 if (b->lockfd >= 0)
@@ -136,7 +137,7 @@ _extnbuf_lock(Extnbuf *b, int *w, int *h, int *stride)
136void 137void
137_extnbuf_unlock(Extnbuf *b) 138_extnbuf_unlock(Extnbuf *b)
138{ 139{
139 if (!b->have_lock) return; 140 if (!b || !b->have_lock) return;
140 if (b->lockfd >= 0) 141 if (b->lockfd >= 0)
141 { 142 {
142 if (lockf(b->lockfd, F_ULOCK, 0) < 0) 143 if (lockf(b->lockfd, F_ULOCK, 0) < 0)