diff options
author | James Almer <jamrial@gmail.com> | 2021-07-27 12:00:03 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-07-27 12:13:32 -0300 |
commit | 487dfa9f04bb825669441476ffd683a7783d5ce9 (patch) | |
tree | 1c73c59d0ee4b4bec29966561f7f43b056c394ff /libavformat/concat.c | |
parent | bc5faacc3f38484e3e9ee2f0143d0ad6884ec747 (diff) | |
download | ffmpeg-487dfa9f04bb825669441476ffd683a7783d5ce9.tar.gz |
avformat/concat: check the terminating character returned by av_get_token()
Don't attempt to increase the cursor pointer if it was \0.
Fixes invalid reads.
Reviewed-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/concat.c')
-rw-r--r-- | libavformat/concat.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/concat.c b/libavformat/concat.c index aec1f52d8e..2560811ff9 100644 --- a/libavformat/concat.c +++ b/libavformat/concat.c @@ -251,7 +251,8 @@ static av_cold int concatf_open(URLContext *h, const char *uri, int flags) err = AVERROR(ENOMEM); break; } - cursor++; + if (*cursor) + cursor++; if (++len == SIZE_MAX / sizeof(*nodes)) { av_free(node_uri); |