[vlc-commits] misc: medialibrary: add missing error check

Filip Roséen git at videolan.org
Fri Jul 20 11:12:10 CEST 2018


vlc | branch: master | Filip Roséen <filip at atch.se> | Fri Jul 20 03:52:39 2018 +0200| [3bc2bf43762a52674a753e185d10d9d945286d44] | committer: Hugo Beauzée-Luyssen

misc: medialibrary: add missing error check

If vlc_event_attach fails there is no way for us to know when to stop
waiting for the item to finish, meaning that we would get stuck
forever.

(cherry picked from commit 5af57c0e3726963108e871ca3e4811003a1add36)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 modules/misc/medialibrary/MetadataExtractor.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/misc/medialibrary/MetadataExtractor.cpp b/modules/misc/medialibrary/MetadataExtractor.cpp
index 122085ac10..3abca1c04d 100644
--- a/modules/misc/medialibrary/MetadataExtractor.cpp
+++ b/modules/misc/medialibrary/MetadataExtractor.cpp
@@ -166,8 +166,9 @@ medialibrary::parser::Status MetadataExtractor::run( medialibrary::parser::IItem
     if ( ctx.input == nullptr )
         return medialibrary::parser::Status::Fatal;
 
-    vlc_event_attach( &ctx.inputItem->event_manager, vlc_InputItemSubItemTreeAdded,
-                      &MetadataExtractor::onSubItemAdded, std::addressof( ctx ) );
+    if( vlc_event_attach( &ctx.inputItem->event_manager, vlc_InputItemSubItemTreeAdded,
+                          &MetadataExtractor::onSubItemAdded, std::addressof( ctx ) ) )
+        return medialibrary::parser::Status::Fatal;
 
     input_Start( ctx.input.get() );
 



More information about the vlc-commits mailing list