mirror of
https://github.com/mpv-player/mpv
synced 2025-04-29 06:42:55 +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;
|
bool is_streaming;
|
||||||
int stream_origin;
|
int stream_origin;
|
||||||
struct mp_cancel *cancel;
|
struct mp_cancel *cancel;
|
||||||
char *filename;
|
const char *filename;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct demuxer *open_given_type(struct mpv_global *global,
|
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,
|
.is_streaming = stream->streaming,
|
||||||
.stream_origin = stream->stream_origin,
|
.stream_origin = stream->stream_origin,
|
||||||
.cancel = cancel,
|
.cancel = cancel,
|
||||||
.filename = talloc_strdup(NULL, stream->url),
|
.filename = stream->url,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Test demuxers from first to last, one pass for each check_levels[] entry
|
// 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:
|
done:
|
||||||
talloc_free(sinfo.filename);
|
|
||||||
talloc_free(log);
|
talloc_free(log);
|
||||||
return demuxer;
|
return demuxer;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user