Skip to content
Snippets Groups Projects
Commit 012ad611 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

Media: Fix use after free

parent eae999f6
No related branches found
No related tags found
No related merge requests found
...@@ -930,7 +930,7 @@ private: ...@@ -930,7 +930,7 @@ private:
/// ///
/// \brief C++ Type wrapper for libvlc_media_slave_t /// \brief C++ Type wrapper for libvlc_media_slave_t
/// ///
class MediaSlave : private libvlc_media_slave_t class MediaSlave
{ {
public: public:
/// ///
...@@ -942,26 +942,33 @@ public: ...@@ -942,26 +942,33 @@ public:
Audio = libvlc_media_slave_type_audio Audio = libvlc_media_slave_type_audio
}; };
MediaSlave(libvlc_media_slave_t *other) : MediaSlave( libvlc_media_slave_t *m )
libvlc_media_slave_t(*other) : m_type( static_cast<Type>( m->i_type ) )
, m_priority( m->i_priority )
, m_uri( m->psz_uri )
{ {
} }
public: public:
Type type() const Type type() const
{ {
return (Type)i_type; return m_type;
} }
unsigned priority() const 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;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment