mirror of
https://github.com/mpv-player/mpv
synced 2025-01-12 18:02:36 +00:00
demux: constify a struct member
Fixes a segfault when an invalid demuxer is given due to uninitialized use of `filename` after goto.
This commit is contained in:
parent
84f6d7a97e
commit
3e85df3b2d
@ -3263,7 +3263,7 @@ struct parent_stream_info {
|
||||
bool is_streaming;
|
||||
int stream_origin;
|
||||
struct mp_cancel *cancel;
|
||||
char *filename;
|
||||
const char *filename;
|
||||
};
|
||||
|
||||
static struct demuxer *open_given_type(struct mpv_global *global,
|
||||
@ -3433,7 +3433,7 @@ static struct demuxer *demux_open(struct stream *stream,
|
||||
.is_streaming = stream->streaming,
|
||||
.stream_origin = stream->stream_origin,
|
||||
.cancel = cancel,
|
||||
.filename = talloc_strdup(NULL, stream->url),
|
||||
.filename = stream->url,
|
||||
};
|
||||
|
||||
// Test demuxers from first to last, one pass for each check_levels[] entry
|
||||
@ -3455,7 +3455,6 @@ static struct demuxer *demux_open(struct stream *stream,
|
||||
}
|
||||
|
||||
done:
|
||||
talloc_free(sinfo.filename);
|
||||
talloc_free(log);
|
||||
return demuxer;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user