]> git.sesse.net Git - ffmpeg/commitdiff
avformat/hlsenc: Always treat numbers as decimal
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 15 Jun 2020 03:09:07 +0000 (05:09 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 15 Jun 2020 03:09:07 +0000 (05:09 +0200)
c801ab43c36e8c4f88121aa09af26c77bcbd671b caused a regression: The stream
number is now parsed with strtoll without a fixed basis; as a
consequence, the "010" in a variant stream mapping like "a:010" is now
treated as an octal number (i.e. as eight, not ten). This was not
intended and may break some scripts, so this commit restores the old
behaviour.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/hlsenc.c

index 18256cbf91835796b1844230fcb429d5b2dd62b6..71fa3db060b4ddedfffb691d7ca80b24ca041b4c 100644 (file)
@@ -1993,7 +1993,7 @@ static int parse_variant_stream_mapstring(AVFormatContext *s)
                 return AVERROR(EINVAL);
             }
 
-            num = strtoll(val, &end, 0);
+            num = strtoll(val, &end, 10);
             if (!av_isdigit(*val) || *end != '\0') {
                 av_log(s, AV_LOG_ERROR, "Invalid stream number: '%s'\n", val);
                 return AVERROR(EINVAL);