[vlc-commits] demux: adaptive: fix file extension matching
Francois Cartegnie
git at videolan.org
Tue Jul 26 17:16:34 CEST 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jul 26 17:12:41 2016 +0200| [a7ade9fbdbe716637d516ba8a6c6b1b0c265cf91] | committer: Francois Cartegnie
demux: adaptive: fix file extension matching
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a7ade9fbdbe716637d516ba8a6c6b1b0c265cf91
---
modules/demux/adaptive/tools/Helper.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/demux/adaptive/tools/Helper.cpp b/modules/demux/adaptive/tools/Helper.cpp
index 9ad37fe..d45daca 100644
--- a/modules/demux/adaptive/tools/Helper.cpp
+++ b/modules/demux/adaptive/tools/Helper.cpp
@@ -62,8 +62,8 @@ std::string Helper::getFileExtension (const std::string &uri)
extension = uri.substr(0, pos);
else
extension = uri;
- pos = uri.find_last_of('.');
- if(pos == std::string::npos)
+ pos = extension.find_last_of('.');
+ if(pos == std::string::npos || extension.length() - pos < 2)
return std::string();
return extension.substr(pos + 1);
}
More information about the vlc-commits
mailing list