summaryrefslogtreecommitdiffstats
path: root/core/mplayer.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-19 00:22:43 +0100
committerwm4 <wm4@nowhere>2012-11-20 18:00:15 +0100
commit9085b85729bb8eb8e4b96195f651308e912b443f (patch)
treee90bb743530d04dfe053ad46ec5451756a1009e2 /core/mplayer.c
parentefaa73cc7333cee40555a61f7bd829c6deb64e63 (diff)
downloadmpv-9085b85729bb8eb8e4b96195f651308e912b443f.tar.bz2
mpv-9085b85729bb8eb8e4b96195f651308e912b443f.tar.xz
stream: fix dvd:// + cache crashing
The language string was dynamically allocated, which completely fails if the cache is forked (which it usually is). Change it back to a fixed length string, like the original code had it.
Diffstat (limited to 'core/mplayer.c')
-rw-r--r--core/mplayer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index cf475b2e01..ebe52b1b76 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -910,7 +910,7 @@ static struct track *add_stream_track(struct MPContext *mpctx,
track->demuxer_id)
};
stream_control(track->demuxer->stream, STREAM_CTRL_GET_LANG, &req);
- track->lang = talloc_steal(track, req.name);
+ track->lang = talloc_strdup(track, req.name);
}
return track;
@@ -941,7 +941,7 @@ static void add_dvd_tracks(struct MPContext *mpctx)
struct stream_lang_req req = {.type = STREAM_SUB, .id = n};
stream_control(stream, STREAM_CTRL_GET_LANG, &req);
- track->lang = talloc_steal(track, req.name);
+ track->lang = talloc_strdup(track, req.name);
}
}
#endif