From 4f2a24899ec16e3fdd974fbdb6e2e668fd10bf4a Mon Sep 17 00:00:00 2001 From: satbaby Date: Wed, 2 May 2012 19:41:24 +0200 Subject: [PATCH] pictureviewer.cpp: fix possible segfault --- src/gui/pictureviewer.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 700f076e8..151f1520e 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -430,16 +430,19 @@ int CPictureViewerGui::show() } else if (msg==CRCInput::RC_blue) { - if ((m_state == MENU) && (!playlist.empty())) + if(!playlist.empty()) { - m_time=(long)time(NULL); - view(selected); - m_state=SLIDESHOW; - } else { - if (m_state == SLIDESHOW) - m_state = VIEW; - else - m_state = SLIDESHOW; + if (m_state == MENU) + { + m_time=(long)time(NULL); + view(selected); + m_state=SLIDESHOW; + } else { + if (m_state == SLIDESHOW) + m_state = VIEW; + else + m_state = SLIDESHOW; + } } } else if (msg==CRCInput::RC_help)