diff mbox series

[FFmpeg-devel] avformat/hlsenc: Always treat numbers as decimal

Message ID 20200615031432.26565-1-andreas.rheinhardt@gmail.com
State Accepted
Commit 19a876fd6973724521dd5e7cc8f8e4683b19eda4
Headers show
Series [FFmpeg-devel] avformat/hlsenc: Always treat numbers as decimal
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt June 15, 2020, 3:14 a.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andreas Rheinhardt June 15, 2020, 3:36 a.m. UTC | #1
Andreas Rheinhardt:
> 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 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 18256cbf91..71fa3db060 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -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);
> 
Pushed after Steven Liu LGTM'ed it on IRC.

- Andreas
diff mbox series

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 18256cbf91..71fa3db060 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -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);