[vlc-commits] dvdnav: also white-list *.img files (fixes #4951)

Rémi Denis-Courmont git at videolan.org
Sat Jun 18 11:33:11 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jun 18 12:05:28 2011 +0300| [00eb305f2afebf28dd649d507aca4901d0ad1e8a] | committer: Rémi Denis-Courmont

dvdnav: also white-list *.img files (fixes #4951)

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

 modules/access/dvdnav.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index 8cceae4..b51ee7e 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -1482,8 +1482,11 @@ static int ProbeDVD( const char *psz_name )
     }
 #endif
     /* Match extension as the anchor exhibits too many false positives */
-    const size_t len = strlen( psz_name );
-    if( len < 4 || strcasecmp( psz_name + len - 4, ".iso" ) )
+    const char *ext = strrchr( psz_name, '.' );
+    if( ext == NULL )
+        goto bailout;
+    ext++;
+    if( strcasecmp( ext, "iso" ) && strcasecmp( ext, "img" ) )
         goto bailout;
 
     /* Try to find the anchor (2 bytes at LBA 256) */



More information about the vlc-commits mailing list