[vlc-devel] commit: taglib: Check if a tablig string is !null and !empty before we try to use it. ( Derk-Jan Hartman )

git version control git at videolan.org
Wed Oct 8 20:41:34 CEST 2008


vlc | branch: 0.9-bugfix | Derk-Jan Hartman <hartman at videolan.org> | Wed Oct  8 20:37:26 2008 +0200| [928dc811085842a0275cec52f18499dafe4b27ce] | committer: Derk-Jan Hartman 

taglib: Check if a tablig string is !null and !empty before we try to use it.
(cherry picked from commit 1f0135f40beac4cef88a398238e1e55cdcf5a268)

Signed-off-by: Derk-Jan Hartman <hartman at videolan.org>

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

 modules/meta_engine/taglib.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index b125966..e08f5e7 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -409,7 +409,8 @@ vlc_meta_Set##bar( p_meta, p_t->toString().toCString(true))
         }
     }
 
-#define SET( foo, bar ) vlc_meta_Set##foo( p_meta, p_tag->bar ().toCString(true))
+#define SET( foo, bar ) if( !p_tag->bar ().isNull() && !p_tag->bar ().isEmpty() ) \
+        vlc_meta_Set##foo( p_meta, p_tag->bar ().toCString(true))
 #define SETINT( foo, bar ) { \
         char psz_tmp[10]; \
         snprintf( (char*)psz_tmp, 10, "%d", p_tag->bar() ); \




More information about the vlc-devel mailing list