Skip to content

Commit

Permalink
cog-platform-fdo: guard against null egl_window
Browse files Browse the repository at this point in the history
Similar to weston-simple-egl only call wl_egl_window_resize
if we have a window. This solves a crash on iMX8M Vivante
GPU blob

Thread 1 "cog" received signal SIGSEGV, Segmentation fault.
wl_egl_window_resize (window=0x0, width=3840, height=2160, dx=0, dy=0)
    at /usr/src/debug/gpu-viv-wl/git-r0/git/driver/driver/khronos/libEGL/api/gc_egl_wayland.c:2124
2124    /usr/src/debug/gpu-viv-wl/git-r0/git/driver/driver/khronos/libEGL/api/gc_egl_wayland.c: No such file or directory.
(gdb) bt
    at /usr/src/debug/gpu-viv-wl/git-r0/git/driver/driver/khronos/libEGL/api/gc_egl_wayland.c:2124
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Signed-off-by: Peter Griffin <[email protected]>
  • Loading branch information
petegriffin authored and aperezdc committed Dec 13, 2018
1 parent f343e46 commit a4663e6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions platform/cog-platform-fdo.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,11 @@ configure_surface_geometry (int32_t width, int32_t height)
static void
resize_window (void)
{
wl_egl_window_resize (win_data.egl_window,
win_data.width,
win_data.height,
0, 0);
if (win_data.egl_window)
wl_egl_window_resize (win_data.egl_window,
win_data.width,
win_data.height,
0, 0);

wpe_view_backend_dispatch_set_size (wpe_view_data.backend,
win_data.width,
Expand Down

0 comments on commit a4663e6

Please sign in to comment.