[PATCH weston 3/4] rpi: avoid segfault in `rpir_view_compute_rects()` when EGL client destroys buffer

Pekka Paalanen ppaalanen at gmail.com
Tue Sep 8 06:22:56 PDT 2015


On Sat,  5 Sep 2015 15:01:39 +0100
John Sadler <deathofathousandpapercuts at gmail.com> wrote:

> 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 at gmail.com>
> ---
>  src/rpi-renderer.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/rpi-renderer.c b/src/rpi-renderer.c
> index a096033..447234f 100644
> --- a/src/rpi-renderer.c
> +++ b/src/rpi-renderer.c
> @@ -703,8 +703,12 @@ 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 {
>  		src_width = view->surface->front->width << 16;
>  		src_height = view->surface->front->height << 16;

Hi John,

right. I removed that extra newline, fixed the summary, and pushed this:
   cdb91d0..960b5eb  master -> master


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150908/147aa000/attachment.sig>


More information about the wayland-devel mailing list