[vlc-commits] Qt: avoid a crash in preferences, on Windows

Jean-Baptiste Kempf git at videolan.org
Tue Sep 18 18:36:24 CEST 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Sep 18 18:35:39 2012 +0200| [c42c41071316b6166ef2ebe386c5daf7b47b99c7] | committer: Jean-Baptiste Kempf

Qt: avoid a crash in preferences, on Windows

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

 modules/gui/qt4/components/preferences_widgets.cpp |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp
index 72b9781..9031a00 100644
--- a/modules/gui/qt4/components/preferences_widgets.cpp
+++ b/modules/gui/qt4/components/preferences_widgets.cpp
@@ -433,8 +433,11 @@ void StringListConfigControl::finish(module_config_t *p_module_config )
     char **values, **texts;
     ssize_t count = config_GetPszChoices( p_this, p_item->psz_name,
                                           &values, &texts );
-    for( ssize_t i = 0; i < count; i++ )
+    for( ssize_t i = 0; i < count && texts; i++ )
     {
+        if( texts[i] == NULL || values[i] == NULL )
+            continue;
+
         combo->addItem( qfu(texts[i]), QVariant( qfu(values[i])) );
         if( !strcmp( p_item->value.psz ? p_item->value.psz : "", values[i] ) )
             combo->setCurrentIndex( combo->count() - 1 );



More information about the vlc-commits mailing list