[vlc-devel] commit: Qt: DO NOT use qobject_cast without checking it! ( Jean-Baptiste Kempf )

git version control git at videolan.org
Sun Jan 10 15:57:48 CET 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Jan 10 15:56:51 2010 +0100| [b62a28b2aa8620122f2d40ae85a49626fdf6b48a] | committer: Jean-Baptiste Kempf 

Qt: DO NOT use qobject_cast without checking it!

How difficult is that?
Fix crash introduced by 1a4bb0599422791234aced46449a017e54ac6115

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b62a28b2aa8620122f2d40ae85a49626fdf6b48a
---

 modules/gui/qt4/components/controller_widget.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/components/controller_widget.cpp b/modules/gui/qt4/components/controller_widget.cpp
index 831c20e..27f7de1 100644
--- a/modules/gui/qt4/components/controller_widget.cpp
+++ b/modules/gui/qt4/components/controller_widget.cpp
@@ -183,7 +183,10 @@ void SoundWidget::updateMuteStatus()
     playlist_t *p_playlist = pl_Hold( p_intf );
     b_is_muted = aout_IsMuted( VLC_OBJECT(p_playlist) );
     pl_Release( p_intf );
-    (qobject_cast<SoundSlider *>(volumeSlider))->setMuted( b_is_muted );
+
+    SoundSlider *soundSlider = qobject_cast<SoundSlider *>(volumeSlider);
+    if( soundSlider )
+        soundSlider->setMuted( b_is_muted );
     refreshLabels();
 }
 




More information about the vlc-devel mailing list