From 9085b85729bb8eb8e4b96195f651308e912b443f Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 19 Nov 2012 00:22:43 +0100 Subject: 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. --- stream/stream_bluray.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'stream/stream_bluray.c') diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c index 5f380458c7..8ee69aaa80 100644 --- a/stream/stream_bluray.c +++ b/stream/stream_bluray.c @@ -30,6 +30,8 @@ */ #include +#include +#include #include "config.h" #include "libavutil/common.h" @@ -215,7 +217,7 @@ static int bluray_stream_control(stream_t *s, int cmd, void *arg) } while (count-- > 0) { if (si->pid == req->id) { - req->name = talloc_strndup(NULL, si->lang, 4); + snprintf(req->name, sizeof(req->name), "%.4s", si->lang); bd_free_title_info(ti); return STREAM_OK; } -- cgit v1.2.3