From 04b9c745d4e4c379724df14a422e35ad81c7bce6 Mon Sep 17 00:00:00 2001 From: Matthias Kretz Date: Fri, 14 Dec 2007 20:00:52 +0100 Subject: Fixed a crash that happened when a video output was closed img->stream->video_fifo can be 0 --- src/xine-engine/video_out.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/xine-engine') diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index b961c6060..a5fd544d0 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -950,6 +950,7 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts, if (!img->stream || _x_stream_info_get(img->stream, XINE_STREAM_INFO_VIDEO_HAS_STILL) || + !img->stream->video_fifo || img->stream->video_fifo->size(img->stream->video_fifo) < 10) { lprintf ("possible still frame\n"); -- cgit v1.2.3 From 8cba2f6983736209def1c838dd53aa5e8c19ec4a Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 15 Dec 2007 04:22:04 +0000 Subject: Remove a stray semicolon. --- src/xine-engine/load_plugins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 2d2f3f3e4..a03ea6d17 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -2533,7 +2533,7 @@ char *xine_get_mime_types (xine_t *self) { cls = (demux_class_t *)node->plugin_class; - if ( cls->mimetypes ); + if ( cls->mimetypes ) len += strlen(cls->mimetypes); } } -- cgit v1.2.3 From 92325b7f17bc96da46dda3445c9f9facec17a485 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Tue, 18 Dec 2007 16:57:13 +0000 Subject: Fix MRL protocol matching (for demuxer lookup). --- src/xine-engine/demux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index 6f9f6381d..5010c60eb 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -464,7 +464,7 @@ int _x_demux_check_extension (const char *mrl, const char *extensions){ while ( ( e = xine_strsep(&ext_work, " ")) != NULL ) { if ( strstr(e, ":/") ) { - if ( strcasecmp (mrl, e) == 0 ) { + if ( strncasecmp (mrl, e, strlen (e)) == 0 ) { found = 1; break; } -- cgit v1.2.3 From c62965b6941f714d69830e3a8fdaf612b14bd543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 18 Dec 2007 20:50:01 +0100 Subject: Remove superfluous include. --- src/xine-engine/scratch.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/scratch.c b/src/xine-engine/scratch.c index 98fed2cdd..8f9021aa1 100644 --- a/src/xine-engine/scratch.c +++ b/src/xine-engine/scratch.c @@ -26,7 +26,6 @@ #include #include -#include /* For memset */ #define LOG_MODULE "scratch" #define LOG_VERBOSE -- cgit v1.2.3 From be6ed0bd6b920c37a823cd599162900120cd3b70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 18 Dec 2007 20:54:54 +0100 Subject: Remove a memset after xine_xmalloc. --- src/xine-engine/metronom.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index 328d2cb3c..e9bd86836 100644 --- a/src/xine-engine/metronom.c +++ b/src/xine-engine/metronom.c @@ -176,7 +176,6 @@ static scr_plugin_t* unixscr_init () { unixscr_t *this; this = (unixscr_t *) xine_xmalloc(sizeof(unixscr_t)); - memset(this, 0, sizeof(*this)); this->scr.interface_version = 3; this->scr.get_priority = unixscr_get_priority; -- cgit v1.2.3 From ef321eddada42f14079be191a9e10c499afd29df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 18 Dec 2007 22:44:19 +0100 Subject: Use variable-sized arrays rather than allocated buffer. --- src/xine-engine/xine.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 17ea5d679..5ad642202 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -850,7 +850,7 @@ static int open_internal (xine_stream_t *stream, const char *mrl) { /* look for the next '#' or try the whole MRL, if none is found */ while (*stream_setup && (stream_setup = (strchr(stream_setup, '#') ? strchr(stream_setup, '#') : strlen(mrl) + mrl))) { - char *input_source = (char *)malloc(stream_setup - mrl + 1); + char input_source[stream_setup - mrl + 1]; memcpy(input_source, mrl, stream_setup - mrl); input_source[stream_setup - mrl] = '\0'; @@ -872,10 +872,8 @@ static int open_internal (xine_stream_t *stream, const char *mrl) { res = (stream->input_plugin->open) (stream->input_plugin); switch(res) { case 1: /* Open successfull */ - free(input_source); break; case -1: /* Open unsuccessfull, but correct plugin */ - free(input_source); stream->err = XINE_ERROR_INPUT_FAILED; _x_flush_events_queues (stream); return 0; @@ -888,7 +886,6 @@ static int open_internal (xine_stream_t *stream, const char *mrl) { if ( res ) break; } - free(input_source); /* if we fail when passing up to the first '#' to the input plugins, * maybe the user stated a (invalid) MRL, with a '#' belonging to the * input source -> look for the next '#' and try again */ @@ -1640,9 +1637,8 @@ static void config_demux_strategy_cb (void *this_gen, xine_cfg_entry_t *entry) { static void config_save_cb (void *this_gen, xine_cfg_entry_t *entry) { xine_t *this = (xine_t *)this_gen; - char *homedir_trail_slash; + char homedir_trail_slash[strlen(xine_get_homedir()) + 2]; - homedir_trail_slash = (char *)malloc(strlen(xine_get_homedir()) + 2); sprintf(homedir_trail_slash, "%s/", xine_get_homedir()); if (entry->str_value[0] && (entry->str_value[0] != '/' || strstr(entry->str_value, "/.") || @@ -1662,7 +1658,6 @@ static void config_save_cb (void *this_gen, xine_cfg_entry_t *entry) { pthread_mutex_unlock(&this->streams_lock); } - free(homedir_trail_slash); this->save_path = entry->str_value; } -- cgit v1.2.3 From 90d290b7abac28a57c4abee41556e5f48064f60d Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Tue, 18 Dec 2007 23:06:30 +0000 Subject: Don't treat # in MRLs as literals or URI-decode raw filenames. [Bug 1784272] --- src/xine-engine/xine.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 097ce99ef..f3b59942d 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -35,6 +35,7 @@ #include #include #include +#include #if defined (__linux__) || defined (__GLIBC__) #include #elif defined (__FreeBSD__) @@ -779,9 +780,9 @@ void _x_flush_events_queues (xine_stream_t *stream) { pthread_mutex_unlock (&stream->event_queues_lock); } -static int open_internal (xine_stream_t *stream, const char *mrl) { +/*static*/ int open_internal (xine_stream_t *stream, const char *mrl) { - const char *stream_setup; + const char *stream_setup = NULL; int no_cache = 0; if (!mrl) { @@ -806,13 +807,19 @@ static int open_internal (xine_stream_t *stream, const char *mrl) { * look for a stream_setup in MRL and try finding an input plugin */ - stream_setup = mrl; - /* look for the next '#' or try the whole MRL, if none is found */ - while (*stream_setup && - (stream_setup = (strchr(stream_setup, '#') ? strchr(stream_setup, '#') : strlen(mrl) + mrl))) { - char *input_source = (char *)malloc(stream_setup - mrl + 1); - memcpy(input_source, mrl, stream_setup - mrl); - input_source[stream_setup - mrl] = '\0'; + if (isalpha (*mrl)) + { + stream_setup = mrl + 1; + while (isalnum (*stream_setup) || *stream_setup == '+' || *stream_setup == '-' || *stream_setup == '.') + ++stream_setup; + if (stream_setup[0] == ':' && stream_setup[1] == '/') + stream_setup = strchr (mrl, '#'); + else + stream_setup = NULL; + } + + { + char *input_source = strndup (mrl, stream_setup ? stream_setup - mrl : strlen (mrl)); /* * find an input plugin @@ -831,7 +838,6 @@ static int open_internal (xine_stream_t *stream, const char *mrl) { res = (stream->input_plugin->open) (stream->input_plugin); switch(res) { case 1: /* Open successfull */ - free(input_source); break; case -1: /* Open unsuccessfull, but correct plugin */ free(input_source); @@ -844,14 +850,9 @@ static int open_internal (xine_stream_t *stream, const char *mrl) { stream->input_plugin = NULL; stream->err = XINE_ERROR_INPUT_FAILED; } - if ( res ) break; } free(input_source); - /* if we fail when passing up to the first '#' to the input plugins, - * maybe the user stated a (invalid) MRL, with a '#' belonging to the - * input source -> look for the next '#' and try again */ - if (*stream_setup) stream_setup++; } if (!stream->input_plugin) { @@ -861,7 +862,7 @@ static int open_internal (xine_stream_t *stream, const char *mrl) { return 0; } - if (*stream_setup) { + if (stream_setup) { while (stream_setup && *stream_setup && *(++stream_setup)) { if (strncasecmp(stream_setup, "demux", 5) == 0) { -- cgit v1.2.3