summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/hlsenc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index a21171c6f9..1bc3cb210b 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1944,10 +1944,13 @@ static int parse_variant_stream_mapstring(AVFormatContext *s)
return AVERROR(EINVAL);
q = varstr;
- while (q < varstr + strlen(varstr)) {
+ while (1) {
if (!av_strncasecmp(q, "a:", 2) || !av_strncasecmp(q, "v:", 2) ||
!av_strncasecmp(q, "s:", 2))
vs->nb_streams++;
+ q = strchr(q, ',');
+ if (!q)
+ break;
q++;
}
vs->streams = av_mallocz(sizeof(AVStream *) * vs->nb_streams);