mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-27 01:01:07 +00:00
avformat/concatdec: use av_strstart()
Fixes: out array read Fixes: 26610/clusterfuzz-testcase-minimized-ffmpeg_dem_CONCAT_fuzzer-5631838049271808 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
3308bbf776
commit
2610acb49a
@ -113,7 +113,8 @@ static int add_file(AVFormatContext *avf, char *filename, ConcatFile **rfile,
|
|||||||
ConcatFile *file;
|
ConcatFile *file;
|
||||||
char *url = NULL;
|
char *url = NULL;
|
||||||
const char *proto;
|
const char *proto;
|
||||||
size_t url_len, proto_len;
|
const char *ptr;
|
||||||
|
size_t url_len;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (cat->safe > 0 && !safe_filename(filename)) {
|
if (cat->safe > 0 && !safe_filename(filename)) {
|
||||||
@ -122,9 +123,8 @@ static int add_file(AVFormatContext *avf, char *filename, ConcatFile **rfile,
|
|||||||
}
|
}
|
||||||
|
|
||||||
proto = avio_find_protocol_name(filename);
|
proto = avio_find_protocol_name(filename);
|
||||||
proto_len = proto ? strlen(proto) : 0;
|
if (proto && av_strstart(filename, proto, &ptr) &&
|
||||||
if (proto && !memcmp(filename, proto, proto_len) &&
|
(*ptr == ':' || *ptr == ',')) {
|
||||||
(filename[proto_len] == ':' || filename[proto_len] == ',')) {
|
|
||||||
url = filename;
|
url = filename;
|
||||||
filename = NULL;
|
filename = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user