[vlc-commits] demux: asf: reject DRM'ed files

Francois Cartegnie git at videolan.org
Fri Nov 22 17:21:19 CET 2013


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Nov 22 17:11:25 2013 +0100| [23445cd543c69113f4f82bce7362d6fc20cc0bfa] | committer: Francois Cartegnie

demux: asf: reject DRM'ed files

Keep #8241 open ???

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

 modules/demux/asf/asf.c    |   11 +++++++++++
 modules/demux/asf/libasf.c |   16 ++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index befcf59..a8563be 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -755,6 +755,17 @@ static int DemuxInit( demux_t *p_demux )
         goto error;
     }
 
+    if ( ASF_FindObject( p_sys->p_root->p_hdr,
+                         &asf_object_content_encryption_guid, 0 ) != NULL
+         || ASF_FindObject( p_sys->p_root->p_hdr,
+                            &asf_object_extended_content_encryption_guid, 0 ) != NULL
+         || ASF_FindObject( p_sys->p_root->p_hdr,
+                         &asf_object_advanced_content_encryption_guid, 0 ) != NULL )
+    {
+        msg_Warn( p_demux, "ASF plugin discarded (DRM encumbered content)" );
+        goto error;
+    }
+
     p_sys->i_track = ASF_CountObject( p_sys->p_root->p_hdr,
                                       &asf_object_stream_properties_guid );
     if( p_sys->i_track <= 0 )
diff --git a/modules/demux/asf/libasf.c b/modules/demux/asf/libasf.c
index 79b1090..9170e20 100644
--- a/modules/demux/asf/libasf.c
+++ b/modules/demux/asf/libasf.c
@@ -1241,6 +1241,13 @@ static void ASF_FreeObject_marker( asf_object_t *p_obj)
     FREENULL( p_mk->name );
 }
 
+static int ASF_ReadObject_Raw(stream_t *s, asf_object_t *p_obj)
+{
+    VLC_UNUSED(s);
+    VLC_UNUSED(p_obj);
+    return VLC_SUCCESS;
+}
+
 #if 0
 static int ASF_ReadObject_XXX(stream_t *s, asf_object_t *p_obj)
 {
@@ -1318,6 +1325,12 @@ static const struct
     { &asf_object_extended_content_description, ASF_OBJECT_OTHER,
       ASF_ReadObject_extended_content_description,
       ASF_FreeObject_extended_content_description },
+    { &asf_object_content_encryption_guid, ASF_OBJECT_OTHER,
+      ASF_ReadObject_Raw, ASF_FreeObject_Null },
+    { &asf_object_advanced_content_encryption_guid, ASF_OBJECT_OTHER,
+      ASF_ReadObject_Raw, ASF_FreeObject_Null },
+    { &asf_object_extended_content_encryption_guid, ASF_OBJECT_OTHER,
+      ASF_ReadObject_Raw, ASF_FreeObject_Null },
 
     { &asf_object_null_guid, 0, NULL, NULL }
 };
@@ -1468,6 +1481,9 @@ static const struct
     { &asf_object_advanced_mutual_exclusion, "Advanced Mutual Exclusion" },
     { &asf_object_stream_prioritization, "Stream Prioritization" },
     { &asf_object_extended_content_description, "Extended content description"},
+    { &asf_object_content_encryption_guid, "Content Encryption"},
+    { &asf_object_advanced_content_encryption_guid, "Advanced Content Encryption"},
+    { &asf_object_extended_content_encryption_guid, "Entended Content Encryption"},
 
     { NULL, "Unknown" },
 };



More information about the vlc-commits mailing list