summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-26 21:34:58 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-26 21:34:58 +0100
commitadebdd278b8e21e7ffeb107af0b3e25534edc796 (patch)
tree826f24088df473dcc5bbe62647f59817c40aa270 /playlist.c
parent3ed2d21eddf76ebe1bf05d8624ff50598a1c8d28 (diff)
parent7262368b6897b41188f0cf6844ca875027d425a4 (diff)
Merge branch 'master' into devel
Conflicts: plugins/alsa/alsa.c streamer.c
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/playlist.c b/playlist.c
index c370611e..eb2dccf6 100644
--- a/playlist.c
+++ b/playlist.c
@@ -719,6 +719,8 @@ pl_insert_file (playItem_t *after, const char *fname, int *pabort, int (*cb)(pla
if (strncasecmp (fname, "file://", 7)) {
const char *p = fname;
int detect_on_access = 1;
+
+ // check if it's URI
for (; *p; p++) {
if (!strncmp (p, "://", 3)) {
break;
@@ -728,7 +730,18 @@ pl_insert_file (playItem_t *after, const char *fname, int *pabort, int (*cb)(pla
break;
}
}
+
if (detect_on_access && *p == ':') {
+ // check for wrong chars like CR/LF, TAB, etc
+ // they are not allowed and might lead to corrupt display in GUI
+ int32_t i = 0;
+ while (fname[i]) {
+ uint32_t c = u8_nextchar (fname, &i);
+ if (c < 0x20) {
+ return NULL;
+ }
+ }
+
playItem_t *it = pl_item_alloc ();
it->decoder_id = NULL;
it->fname = strdup (fname);