mirror of https://github.com/mpv-player/mpv
stream_slice: fix use-after-free if inner stream fails to open
The args struct is reused to attempt opening an URL with different stream layers, overwriting args->url not only breaks this but also causes the freed buffer to be used again.
This commit is contained in:
parent
6479646f41
commit
6be613c178
|
@ -151,8 +151,9 @@ static int open2(struct stream *stream, struct stream_open_args *args)
|
|||
return parse_ret;
|
||||
}
|
||||
|
||||
args->url = stream->path;
|
||||
int inner_ret = stream_create_with_args(args, &p->inner);
|
||||
struct stream_open_args args2 = *args;
|
||||
args2.url = stream->path;
|
||||
int inner_ret = stream_create_with_args(&args2, &p->inner);
|
||||
if (inner_ret != STREAM_OK) {
|
||||
return inner_ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue