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

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


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

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

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

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

diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index 8cceae4..45b9d33 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -1482,8 +1482,10 @@ 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;
+    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