summaryrefslogtreecommitdiff
path: root/libavformat/concat.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/concat.c')
-rw-r--r--libavformat/concat.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libavformat/concat.c b/libavformat/concat.c
index 418405dd50..278afd997d 100644
--- a/libavformat/concat.c
+++ b/libavformat/concat.c
@@ -73,14 +73,11 @@ static av_cold int concat_open(URLContext *h, const char *uri, int flags)
for (i = 0, len = 1; uri[i]; i++) {
if (uri[i] == *AV_CAT_SEPARATOR) {
- /* integer overflow */
- if (++len == UINT_MAX / sizeof(*nodes)) {
- return AVERROR(ENAMETOOLONG);
- }
+ len++;
}
}
- if (!(nodes = av_realloc(NULL, sizeof(*nodes) * len)))
+ if (!(nodes = av_realloc_array(NULL, len, sizeof(*nodes))))
return AVERROR(ENOMEM);
else
data->nodes = nodes;