summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Sadler <deathofathousandpapercuts@gmail.com>2015-09-05 15:01:39 +0100
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-09-08 16:21:45 +0300
commit960b5ebd825763c89386f265cb377092beee061a (patch)
treef38946720e88d1af6d8cf030922ef3c32d9a1a8b
parentcdb91d019f9d3af7ffe6df3ccbe27c1bdac47791 (diff)
rpi: avoid segfault in rpir_view_compute_rects() when EGL client destroys buffer
This commit works-around a serious issue when running with the RPi backend. When an EGL client shuts down and destroys it's EGL window, Weston dies with a segmentation fault in the above function (because `buffer` is now NULL). The addition of a simple NULL check avoids the problem. This is a minor re-formatting of the patch already submitted here: http://patchwork.freedesktop.org/patch/34885 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85167 Signed-off-by: John Sadler <deathofathousandpapercuts@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-rw-r--r--src/rpi-renderer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rpi-renderer.c b/src/rpi-renderer.c
index a0960334..d0a97974 100644
--- a/src/rpi-renderer.c
+++ b/src/rpi-renderer.c
@@ -703,6 +703,9 @@ rpir_view_compute_rects(struct rpir_view *view,
struct weston_buffer *buffer =
view->surface->egl_front->buffer_ref.buffer;
+ if (!buffer)
+ return -1;
+
src_width = buffer->width << 16;
src_height = buffer->height << 16;
} else {