[vlc-commits] mkv: Check file extensions in a case insensitive way

Hugo Beauzée-Luyssen git at videolan.org
Wed Feb 15 11:03:03 CET 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Feb 15 10:58:39 2017 +0100| [d991e431c88d99364f1a74f4e6dc339c82ec675d] | committer: Hugo Beauzée-Luyssen

mkv: Check file extensions in a case insensitive way

Fix #18017

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

 modules/demux/mkv/mkv.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index c3f9ace..47e4d3e 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -192,8 +192,8 @@ static int Open( vlc_object_t * p_this )
                             continue; // don't reuse the original opened file
                         }
 
-                        if (!s_filename.compare(s_filename.length() - 3, 3, "mkv") ||
-                            !s_filename.compare(s_filename.length() - 3, 3, "mka"))
+                        if (!strncasecmp(s_filename.c_str() + s_filename.length() - 3, "mkv", 3) ||
+                            !strncasecmp(s_filename.c_str() + s_filename.length() - 3, "mka", 3))
                         {
                             // test whether this file belongs to our family
                             const uint8_t *p_peek;
@@ -760,7 +760,7 @@ static int Demux( demux_t *p_demux)
         for( tracks_map_t::iterator it = p_segment->tracks.begin(); it != p_segment->tracks.end(); ++it )
         {
             tracks_map_t::mapped_type& track = it->second;
-      
+
             if( track.i_last_dts == VLC_TS_INVALID )
                 continue;
 



More information about the vlc-commits mailing list