[vlc-devel] [PATCH 1/2] demux: adaptive: fix out of range exception

Francois Cartegnie fcvlcdev at free.fr
Tue Oct 17 19:01:19 CEST 2017


Le 12/10/2017 à 10:11, Zhao Zhili a écrit :
> 
> ---
>  modules/demux/adaptive/http/HTTPConnection.cpp | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/modules/demux/adaptive/http/HTTPConnection.cpp b/modules/demux/adaptive/http/HTTPConnection.cpp
> index 5934fb7270..a1f81b61d8 100644
> --- a/modules/demux/adaptive/http/HTTPConnection.cpp
> +++ b/modules/demux/adaptive/http/HTTPConnection.cpp
> @@ -246,10 +246,9 @@ int HTTPConnection::parseReply()
>          size_t split = lines.find_first_of(':');
>          if(split != std::string::npos)
>          {
> -            size_t value = split + 1;
> -            while(lines.at(value) == ' ')
> -                value++;
> -
> +            size_t value = lines.find_first_not_of(' ', split + 1);
> +            if(value == std::string::npos)
> +                value = lines.length();
>              onHeader(lines.substr(0, split), lines.substr(value));
>              lines = std::string();
>          }
> 

I don't understand what this changes.


-- 
Francois Cartegnie
VideoLAN - VLC Developer


More information about the vlc-devel mailing list