]> git.sesse.net Git - vlc/commitdiff
Zip filter: skip .vlt & .wsz (skins)
authorJean-Philippe André <jpeg@videolan.org>
Mon, 31 May 2010 05:43:20 +0000 (13:43 +0800)
committerJean-Philippe André <jpeg@videolan.org>
Mon, 31 May 2010 06:04:57 +0000 (14:04 +0800)
modules/access/zip/zipstream.c

index ae6316f9bae4fc3ad97c00d77763f86f4f461810..c862204def0a570701e0dd9c775dd328018b34b8 100644 (file)
@@ -172,6 +172,18 @@ int StreamOpen( vlc_object_t *p_this )
     stream_t *s = (stream_t*) p_this;
     stream_sys_t *p_sys;
 
+    /* Verify file extension: discard .vlt files (skins) */
+    char *psz_ext = strrchr( s->psz_path, '.' );
+    if( psz_ext )
+    {
+        if( !strncasecmp( psz_ext, ".vlt", 4 ) ||
+            !strncasecmp( psz_ext, ".wsz", 4 ) )
+        {
+            msg_Dbg( s, "skipping skins package (*.vlt, *.wsz)" );
+            return VLC_EGENERIC;
+        }
+    }
+
     /* Verify file format */
     const uint8_t *p_peek;
     if( stream_Peek( s->p_source, &p_peek, i_zip_marker ) < i_zip_marker )