summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2023-02-24 13:19:47 +0100
committersfan5 <sfan5@live.de>2023-02-24 13:22:03 +0100
commit3e85df3b2d89d6a27806d677b6b8a99055cb1fcc (patch)
tree19b0905f260578d90a4ab462412d93466d190fdd /demux
parent84f6d7a97eda8a303cfbb4553fa736c67c19280d (diff)
downloadmpv-3e85df3b2d89d6a27806d677b6b8a99055cb1fcc.tar.bz2
mpv-3e85df3b2d89d6a27806d677b6b8a99055cb1fcc.tar.xz
demux: constify a struct member
Fixes a segfault when an invalid demuxer is given due to uninitialized use of `filename` after goto.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 3d4c2fb692..cac2f74ec8 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -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;
}