Merge branch 'v0.17.x'
This commit is contained in:
commit
2a4c799471
1
NEWS
1
NEWS
@ -20,6 +20,7 @@ ver 0.17.2 (2012/??/??)
|
|||||||
* playlist: fix memory leak
|
* playlist: fix memory leak
|
||||||
* state_file: save song priorities
|
* state_file: save song priorities
|
||||||
* player: disable cross-fading in "single" mode
|
* player: disable cross-fading in "single" mode
|
||||||
|
* update: fix unsafe readlink() usage
|
||||||
|
|
||||||
|
|
||||||
ver 0.17.1 (2012/07/31)
|
ver 0.17.1 (2012/07/31)
|
||||||
|
@ -216,7 +216,7 @@ default is 5.
|
|||||||
.TP
|
.TP
|
||||||
.B max_playlist_length <number>
|
.B max_playlist_length <number>
|
||||||
This specifies the maximum number of songs that can be in the playlist. The
|
This specifies the maximum number of songs that can be in the playlist. The
|
||||||
default is 4096.
|
default is 16384.
|
||||||
.TP
|
.TP
|
||||||
.B max_command_list_size <size in KiB>
|
.B max_command_list_size <size in KiB>
|
||||||
This specifies the maximum size a command list can be. The default is 2048.
|
This specifies the maximum size a command list can be. The default is 2048.
|
||||||
|
@ -33,6 +33,9 @@ struct Compressor {
|
|||||||
struct Compressor *Compressor_new(unsigned int history)
|
struct Compressor *Compressor_new(unsigned int history)
|
||||||
{
|
{
|
||||||
struct Compressor *obj = malloc(sizeof(struct Compressor));
|
struct Compressor *obj = malloc(sizeof(struct Compressor));
|
||||||
|
if (obj == NULL)
|
||||||
|
/* out of memory, not much we can do */
|
||||||
|
abort();
|
||||||
|
|
||||||
obj->prefs.target = TARGET;
|
obj->prefs.target = TARGET;
|
||||||
obj->prefs.maxgain = GAINMAX;
|
obj->prefs.maxgain = GAINMAX;
|
||||||
@ -61,6 +64,10 @@ void Compressor_delete(struct Compressor *obj)
|
|||||||
static int *resizeArray(int *data, int newsz, int oldsz)
|
static int *resizeArray(int *data, int newsz, int oldsz)
|
||||||
{
|
{
|
||||||
data = realloc(data, newsz*sizeof(int));
|
data = realloc(data, newsz*sizeof(int));
|
||||||
|
if (data == NULL)
|
||||||
|
/* out of memory, not much we can do */
|
||||||
|
abort();
|
||||||
|
|
||||||
if (newsz > oldsz)
|
if (newsz > oldsz)
|
||||||
memset(data + oldsz, 0, sizeof(int)*(newsz - oldsz));
|
memset(data + oldsz, 0, sizeof(int)*(newsz - oldsz));
|
||||||
return data;
|
return data;
|
||||||
|
@ -33,12 +33,14 @@ ogg_stream_type ogg_stream_type_detect(struct input_stream *inStream)
|
|||||||
size_t r;
|
size_t r;
|
||||||
|
|
||||||
r = decoder_read(NULL, inStream, buf, sizeof(buf));
|
r = decoder_read(NULL, inStream, buf, sizeof(buf));
|
||||||
if (r >= 32 && memcmp(buf, "OggS", 4) == 0 && (
|
if (r < sizeof(buf) || memcmp(buf, "OggS", 4) != 0)
|
||||||
(memcmp(buf+29, "FLAC", 4) == 0
|
return VORBIS;
|
||||||
&& memcmp(buf+37, "fLaC", 4) == 0)
|
|
||||||
|| (memcmp(buf+28, "FLAC", 4) == 0)
|
if ((memcmp(buf + 29, "FLAC", 4) == 0 &&
|
||||||
|| (memcmp(buf+28, "fLaC", 4) == 0))) {
|
memcmp(buf + 37, "fLaC", 4) == 0) ||
|
||||||
|
memcmp(buf + 28, "FLAC", 4) == 0 ||
|
||||||
|
memcmp(buf + 28, "fLaC", 4) == 0)
|
||||||
return FLAC;
|
return FLAC;
|
||||||
}
|
|
||||||
return VORBIS;
|
return VORBIS;
|
||||||
}
|
}
|
||||||
|
@ -283,12 +283,20 @@ skip_symlink(const struct directory *directory, const char *utf8_name)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
char buffer[MPD_PATH_MAX];
|
char buffer[MPD_PATH_MAX];
|
||||||
ssize_t ret = readlink(path_fs, buffer, sizeof(buffer));
|
ssize_t length = readlink(path_fs, buffer, sizeof(buffer));
|
||||||
g_free(path_fs);
|
g_free(path_fs);
|
||||||
if (ret < 0)
|
if (length < 0)
|
||||||
/* don't skip if this is not a symlink */
|
/* don't skip if this is not a symlink */
|
||||||
return errno != EINVAL;
|
return errno != EINVAL;
|
||||||
|
|
||||||
|
if ((size_t)length >= sizeof(buffer))
|
||||||
|
/* skip symlinks when the buffer is too small for the
|
||||||
|
link target */
|
||||||
|
return true;
|
||||||
|
|
||||||
|
/* null-terminate the buffer, because readlink() will not */
|
||||||
|
buffer[length] = 0;
|
||||||
|
|
||||||
if (!follow_inside_symlinks && !follow_outside_symlinks) {
|
if (!follow_inside_symlinks && !follow_outside_symlinks) {
|
||||||
/* ignore all symlinks */
|
/* ignore all symlinks */
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user