diff options
author | Eric Engestrom <[email protected]> | 2018-02-15 11:10:22 +0000 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2018-02-16 13:14:29 +0000 |
commit | 65dda6c9ec1d80ee36c8bff157f49d97baffebce (patch) | |
tree | 1fb71e8e03a195e24541e6b9206dc1d49129b335 /src/egl | |
parent | a176b053b6f956db14becd981795e3adad969a13 (diff) |
egl/wayland: check for invalid format index
v2: just tell the compiler to assume the format will always be found, as
it comes from the table itself to begin with. (DanielS)
CID: 1429516
Fixes: d32b23f3830099a328b91 "egl/wayland: Add bpp to visual map"
Signed-off-by: Eric Engestrom <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri2/platform_wayland.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 5b8bec901b0..877f7933b9a 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -1452,6 +1452,8 @@ dri2_wl_swrast_get_stride_for_format(int format, int w) { int visual_idx = dri2_wl_visual_idx_from_shm_format(format); + assume(visual_idx != -1); + return w * (dri2_wl_visuals[visual_idx].bpp / 8); } |