From 71d7352659e2a9082b83193dd794b7225f0e0899 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 14 Jan 2012 13:02:58 -0600 Subject: [PATCH] fix potential segfault --- compton.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compton.c b/compton.c index f4cf938d..4f30bb8d 100644 --- a/compton.c +++ b/compton.c @@ -1455,7 +1455,9 @@ map_win(Display *dpy, Window id, #endif w->damaged = 0; - if (fade && win_type_fade[w->window_type]) { + if (fade && w->window_type >= 0 + && w->window_type < NUM_WINTYPES + && win_type_fade[w->window_type]) { set_fade( dpy, w, 0, get_opacity_percent(dpy, w), fade_in_step, 0, True, True);