diff mbox series

[FFmpeg-devel] avformat/dashdec: check the root url length

Message ID 20200817123018.6898-1-lq@chinaffmpeg.org
State Accepted
Commit 1ee52b2b6c1f6c9618e435b5ed7608442308efe6
Headers show
Series [FFmpeg-devel] avformat/dashdec: check the root url length
Related show

Checks

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

Commit Message

Steven Liu Aug. 17, 2020, 12:30 p.m. UTC
if the length of the root url is 0, unnecessary process the root_url

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/dashdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steven Liu Oct. 20, 2020, 3:43 a.m. UTC | #1
Steven Liu <lq@chinaffmpeg.org> 于2020年8月17日周一 下午8:30写道:
>
> if the length of the root url is 0, unnecessary process the root_url
>
> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
> ---
>  libavformat/dashdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
> index c5a5ff607b..387d97fe42 100644
> --- a/libavformat/dashdec.c
> +++ b/libavformat/dashdec.c
> @@ -776,7 +776,7 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur
>      size = strlen(root_url);
>      isRootHttp = ishttp(root_url);
>
> -    if (root_url[size - 1] != token) {
> +    if (size > 0 && root_url[size - 1] != token) {
>          av_strlcat(root_url, "/", size + 2);
>          size += 2;
>      }
> --
> 2.25.0
>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

pushed


Thanks
Steven
diff mbox series

Patch

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index c5a5ff607b..387d97fe42 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -776,7 +776,7 @@  static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur
     size = strlen(root_url);
     isRootHttp = ishttp(root_url);
 
-    if (root_url[size - 1] != token) {
+    if (size > 0 && root_url[size - 1] != token) {
         av_strlcat(root_url, "/", size + 2);
         size += 2;
     }