Fix OOB when the number of screens change
This commit is contained in:
parent
a47f112833
commit
db700f9be1
|
@ -1778,7 +1778,13 @@ paint_all(session_t *ps, region_t *region, const region_t *region_real, win * co
|
||||||
pixman_region32_subtract(®_tmp, ®_tmp, &bshape);
|
pixman_region32_subtract(®_tmp, ®_tmp, &bshape);
|
||||||
|
|
||||||
#ifdef CONFIG_XINERAMA
|
#ifdef CONFIG_XINERAMA
|
||||||
if (ps->o.xinerama_shadow_crop && w->xinerama_scr >= 0)
|
if (ps->o.xinerama_shadow_crop && w->xinerama_scr >= 0 &&
|
||||||
|
w->xinerama_scr < ps->xinerama_nscrs)
|
||||||
|
// There can be a window where number of screens is updated,
|
||||||
|
// but the screen number attached to the windows have not.
|
||||||
|
//
|
||||||
|
// Window screen number will be updated eventually, so here we
|
||||||
|
// just check to make sure we don't access out of bounds.
|
||||||
pixman_region32_intersect(®_tmp, ®_tmp,
|
pixman_region32_intersect(®_tmp, ®_tmp,
|
||||||
&ps->xinerama_scr_regs[w->xinerama_scr]);
|
&ps->xinerama_scr_regs[w->xinerama_scr]);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue