Alexandre Julliard : explorer: Avoid crashing when the desktop launchers are not initialized.
Module: wine Branch: master Commit: 0d40cdc7796d1e688a0c80576b313aeda13198f8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0d40cdc7796d1e688a0c80576b... Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Oct 18 13:29:39 2013 +0200 explorer: Avoid crashing when the desktop launchers are not initialized. --- programs/explorer/desktop.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 4c38edb..3ea3e60 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -88,8 +88,10 @@ static RECT get_title_rect( unsigned int index ) static const struct launcher *launcher_from_point( int x, int y ) { RECT icon, title; - unsigned int index = x / launcher_size + (y / launcher_size) * launchers_per_row; + unsigned int index; + if (!nb_launchers) return NULL; + index = x / launcher_size + (y / launcher_size) * launchers_per_row; if (index >= nb_launchers) return NULL; icon = get_icon_rect( index ); @@ -523,6 +525,7 @@ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPAR return 0; case WM_LBUTTONDBLCLK: + if (!using_root) { const struct launcher *launcher = launcher_from_point( (short)LOWORD(lp), (short)HIWORD(lp) ); if (launcher) do_launch( launcher );
participants (1)
-
Alexandre Julliard