[vlc-commits] taglib: fix error handling

Rémi Denis-Courmont git at videolan.org
Sat Aug 15 12:24:01 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Aug 15 13:20:43 2015 +0300| [80afc8a70f4cf3145ad4a236a69d0ca218485f10] | committer: Rémi Denis-Courmont

taglib: fix error handling

strdup() is as (un)likely to fail as asprintf().

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

 modules/meta_engine/taglib.cpp |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index d0a76b1..01846ef 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -283,9 +283,12 @@ static void ReadMetaFromASF( ASF::Tag* tag, demux_meta_t* p_demux_meta, vlc_meta
         else
         {
             if( asprintf( &psz_name, "%i", asfPicture.type() ) == -1 )
-                continue;
+                psz_name = NULL;
         }
 
+        if( unlikely(psz_name == NULL) )
+            continue;
+
         msg_Dbg( p_demux_meta, "Found embedded art: %s (%s) is %u bytes",
                  psz_name, psz_mime, i_data );
 



More information about the vlc-commits mailing list