[vlc-commits] [Git][videolan/libvlcpp][master] Media: Fix use after free

Hugo Beauzée-Luyssen gitlab at videolan.org
Thu Jun 25 17:30:59 CEST 2020



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / libvlcpp


Commits:
012ad611 by Hugo Beauzée-Luyssen at 2020-06-25T17:29:20+02:00
Media: Fix use after free

- - - - -


1 changed file:

- vlcpp/structures.hpp


Changes:

=====================================
vlcpp/structures.hpp
=====================================
@@ -930,7 +930,7 @@ private:
 ///
 /// \brief C++ Type wrapper for libvlc_media_slave_t
 ///
-class MediaSlave : private libvlc_media_slave_t
+class MediaSlave
 {
 public:
     ///
@@ -942,26 +942,33 @@ public:
         Audio = libvlc_media_slave_type_audio
     };
 
-    MediaSlave(libvlc_media_slave_t *other) :
-        libvlc_media_slave_t(*other)
+    MediaSlave( libvlc_media_slave_t *m )
+      : m_type( static_cast<Type>( m->i_type ) )
+      , m_priority( m->i_priority )
+      , m_uri( m->psz_uri )
     {
     }
 
 public:
     Type type() const
     {
-        return (Type)i_type;
+        return m_type;
     }
 
     unsigned priority() const
     {
-        return i_priority;
+        return m_priority;
     }
 
-    std::string uri() const
+    const std::string& uri() const
     {
-        return psz_uri;
+        return m_uri;
     }
+
+private:
+    Type m_type;
+    unsigned int m_priority;
+    std::string m_uri;
 };
 
 



View it on GitLab: https://code.videolan.org/videolan/libvlcpp/-/commit/012ad611e846a2f82fc50c046728fe070642e6a5

-- 
View it on GitLab: https://code.videolan.org/videolan/libvlcpp/-/commit/012ad611e846a2f82fc50c046728fe070642e6a5
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list