aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-15 22:56:11 +0200
committerMax Kellermann <max@duempel.org>2012-08-15 22:56:11 +0200
commit8422402c39d523c8ce9336e9ecf52950f1905bce (patch)
tree4c5d3778768890e192685bd9b02f251b9cf85cbf
parentb5fde6dfa55676560ee8805e8e00bc188a5ad928 (diff)
parent9374e0f4454ff5a37f70ce2d6110d5612856a169 (diff)
Merge branch 'v0.17.x'
Conflicts: src/player_thread.c
-rw-r--r--NEWS1
-rw-r--r--src/filter/volume_filter_plugin.c1
-rw-r--r--src/mapper.c6
-rw-r--r--src/player_thread.c4
-rw-r--r--src/playlist.c6
-rw-r--r--src/volume.c1
6 files changed, 12 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 30f44be4..bda00cb2 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ ver 0.17.2 (2012/??/??)
- httpd: use monotonic clock, avoid hiccups after system clock adjustment
- httpd: fix throttling bug after resuming playback
* mapper: fix non-UTF8 music directory name
+* mapper: fix potential crash in file permission check
ver 0.17.1 (2012/07/31)
diff --git a/src/filter/volume_filter_plugin.c b/src/filter/volume_filter_plugin.c
index e52c0a46..3260e898 100644
--- a/src/filter/volume_filter_plugin.c
+++ b/src/filter/volume_filter_plugin.c
@@ -26,7 +26,6 @@
#include "pcm_buffer.h"
#include "pcm_volume.h"
#include "audio_format.h"
-#include "player_control.h"
#include <assert.h>
#include <string.h>
diff --git a/src/mapper.c b/src/mapper.c
index 6a968e32..7db74b1a 100644
--- a/src/mapper.c
+++ b/src/mapper.c
@@ -93,10 +93,10 @@ check_directory(const char *path)
#endif
DIR *dir = opendir(path);
- if (dir == NULL && errno == EACCES)
- g_warning("No permission to read directory: %s", path);
- else
+ if (dir != NULL)
closedir(dir);
+ else if (errno == EACCES)
+ g_warning("No permission to read directory: %s", path);
}
static void
diff --git a/src/player_thread.c b/src/player_thread.c
index 15fc9d23..cf0b9ac8 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -458,6 +458,8 @@ static bool player_seek_decoder(struct player *player)
assert(pc->next_song != NULL);
+ const unsigned start_ms = song->start_ms;
+
if (!decoder_lock_is_current_song(dc, song)) {
/* the decoder is already decoding the "next" song -
stop it and start the previous song again */
@@ -506,7 +508,7 @@ static bool player_seek_decoder(struct player *player)
if (where < 0.0)
where = 0.0;
- if (!dc_seek(dc, where + song->start_ms / 1000.0)) {
+ if (!dc_seek(dc, where + start_ms / 1000.0)) {
/* decoder failure */
player_command_finished(pc);
return false;
diff --git a/src/playlist.c b/src/playlist.c
index b2cb90d2..4c95bc7c 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -239,9 +239,13 @@ playlist_sync(struct playlist *playlist, struct player_control *pc)
if (pc_next_song == NULL && playlist->queued != -1)
playlist_song_started(playlist, pc);
+ player_lock(pc);
+ pc_next_song = pc->next_song;
+ player_unlock(pc);
+
/* make sure the queued song is always set (if
possible) */
- if (pc->next_song == NULL && playlist->queued < 0)
+ if (pc_next_song == NULL && playlist->queued < 0)
playlist_update_queued_song(playlist, pc, NULL);
}
}
diff --git a/src/volume.c b/src/volume.c
index 819e6fbf..d3ce47dd 100644
--- a/src/volume.c
+++ b/src/volume.c
@@ -20,7 +20,6 @@
#include "config.h"
#include "volume.h"
#include "conf.h"
-#include "player_control.h"
#include "idle.h"
#include "pcm_volume.h"
#include "output_all.h"