[vlc-devel] [PATCH 1/2] npapi: fix possible crash

Daniel Amm da2424 at t-online.de
Mon Jan 2 20:05:30 CET 2017


---
 NEWS                          | 3 +++
 npapi/npruntime/npolibvlc.cpp | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/NEWS b/NEWS
index 7bb1c17..ef2afb7 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,9 @@ ActiveX:
  * Allow empty strings for aspectRatio and crop
  * Fix initial volume value for volume attribute
 
+NPAPI:
+ * Fix possible crash in vlc.playlist.add()
+
 
 Changes between VLC plugins 2.2.2 and 2.2.4:
 --------------------------------------------
diff --git a/npapi/npruntime/npolibvlc.cpp b/npapi/npruntime/npolibvlc.cpp
index 820c638..e2da795 100644
--- a/npapi/npruntime/npolibvlc.cpp
+++ b/npapi/npruntime/npolibvlc.cpp
@@ -1133,6 +1133,10 @@ void LibvlcPlaylistNPObject::parseOptions(NPObject *obj, int *i_options,
     NPIdentifier propId = NPN_GetStringIdentifier("length");
     if( NPN_GetProperty(_instance, obj, propId, value) )
     {
+        /* Check if result is valid (because we don't use NPN_HasProperty, the result can be void) */
+        if( !value.is<int>() )
+            return;
+
         int count = value;
 
         if( count )
-- 
2.10.2.windows.1



More information about the vlc-devel mailing list