]> git.sesse.net Git - vlc/commitdiff
demux: asf: reject DRM'ed files
authorFrancois Cartegnie <fcvlcdev@free.fr>
Fri, 22 Nov 2013 16:11:25 +0000 (17:11 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Fri, 22 Nov 2013 16:20:09 +0000 (17:20 +0100)
Keep #8241 open ???

modules/demux/asf/asf.c
modules/demux/asf/libasf.c

index befcf59107a2471a5d8ae3615d40ae096c1e1237..a8563be74bae37472f2e3fe623f517c820268f0b 100644 (file)
@@ -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 )
index 79b109079ccb9c1b65ab283c812de848897f10ef..9170e20aa049dd962e4e1bc7c7a23c45dc5cc738 100644 (file)
@@ -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" },
 };