summaryrefslogtreecommitdiff
path: root/libavformat/dashdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-08-18 02:19:51 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-08-19 02:47:33 +0200
commit46753bfdd0182f721499939a1118c0406c8a3674 (patch)
tree6992de0c422d4065bceecefa2658649315014c81 /libavformat/dashdec.c
parent85c00643b763bc62f3a15c19df44c3f1312bfe81 (diff)
avformat/dashdec: Fix strlen(rep_id_val) with it being NULL
Fixes: dash-crash-da39a3ee5e6b4b0d3255bfef95601890afd80709.xml Found-by: Paul Ch <paulcher@icloud.com> Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/dashdec.c')
-rw-r--r--libavformat/dashdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index f851bbf981..c6dddeb98f 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -857,7 +857,9 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url,
baseurl_nodes[3] = representation_baseurl_node;
ret = resolve_content_path(s, url, &c->max_url_size, baseurl_nodes, 4);
- c->max_url_size = aligned(c->max_url_size + strlen(rep_id_val) + strlen(rep_bandwidth_val));
+ c->max_url_size = aligned(c->max_url_size
+ + (rep_id_val ? strlen(rep_id_val) : 0)
+ + (rep_bandwidth_val ? strlen(rep_bandwidth_val) : 0));
if (ret == AVERROR(ENOMEM) || ret == 0) {
goto end;
}