mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-23 11:39:49 +00:00
avformat/concat: Remove unnecessary check
This code was written when the allocation functions used parameters of type unsigned. This is no longer true today and therefore we only need to check whether the multiplication of the array's size stays within a size_t -- and this can be offloaded to av_realloc_array. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
e38cbb8d19
commit
963d4b76de
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user