From 0255e8710c16840e54443fd40a093df1289a3f58 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Dec 2014 09:42:52 +0100 Subject: [PATCH 1/5] android: release v0.19.7 --- android/AndroidManifest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 616536ab7..fcd251382 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="11" + android:versionName="0.19.7"> From e38faca455995f1ae7df54780ffeed53c8037346 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Dec 2014 09:42:17 +0100 Subject: [PATCH 2/5] configure.ac: prepare for 0.19.8 --- NEWS | 2 ++ android/AndroidManifest.xml | 4 ++-- configure.ac | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 28ab9d591..d33d600d0 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +ver 0.19.8 (not yet released) + ver 0.19.7 (2014/12/17) * input - nfs: fix crash while canceling a failing file open operation diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index fcd251382..a1e045e26 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="12" + android:versionName="0.19.8"> diff --git a/configure.ac b/configure.ac index 66a942288..5b4d577ae 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.19.7, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.19.8, musicpd-dev-team@lists.sourceforge.net) VERSION_MAJOR=0 VERSION_MINOR=19 -VERSION_REVISION=7 +VERSION_REVISION=8 VERSION_EXTRA=0 AC_CONFIG_SRCDIR([src/Main.cxx]) From 35db88affe5d158c1bfda46e4cd0f8c69db4426d Mon Sep 17 00:00:00 2001 From: Jan Brittenson Date: Mon, 22 Dec 2014 22:26:55 -0800 Subject: [PATCH 3/5] DSF ID3 tags hitting 4k size limit Here's a change to dynamically allocate the DSD ID3 tag buffer. Pretty much anything with cover art is going to exceed the existing, static 4k limit... Here's a change to dynamically allocate the buffer and sanity check it at some upper limit. I rather arbitrarily pulled 256k out of thin air just to keep a corrupt file from causing it to trying to allocate a buffer larger than available memory. --- NEWS | 2 ++ src/decoder/plugins/DsdLib.cxx | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index d33d600d0..54e04ab9a 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.19.8 (not yet released) +* decoder + - dsdiff, dsf: allow ID3 tags larger than 4 kB ver 0.19.7 (2014/12/17) * input diff --git a/src/decoder/plugins/DsdLib.cxx b/src/decoder/plugins/DsdLib.cxx index 8892ed387..0436b9c3f 100644 --- a/src/decoder/plugins/DsdLib.cxx +++ b/src/decoder/plugins/DsdLib.cxx @@ -29,6 +29,7 @@ #include "input/InputStream.hxx" #include "tag/TagId3.hxx" #include "util/Error.hxx" +#include "util/Alloc.hxx" #include @@ -123,22 +124,27 @@ dsdlib_tag_id3(InputStream &is, const id3_length_t count = size - offset; - /* Check and limit id3 tag size to prevent a stack overflow */ - id3_byte_t dsdid3[4096]; - if (count == 0 || count > sizeof(dsdid3)) + if (count < 10 || count > 256*1024) return; - if (!decoder_read_full(nullptr, is, dsdid3, count)) - return; + id3_byte_t *const id3_buf = static_cast(xalloc(count)); - struct id3_tag *id3_tag = id3_tag_parse(dsdid3, count); - if (id3_tag == nullptr) + if (!decoder_read_full(nullptr, is, id3_buf, count)) { + free(id3_buf); return; + } + + struct id3_tag *id3_tag = id3_tag_parse(id3_buf, count); + if (id3_tag == nullptr) { + free(id3_buf); + return; + } scan_id3_tag(id3_tag, handler, handler_ctx); id3_tag_delete(id3_tag); + free(id3_buf); return; } #endif From b9c7771830dbecd7278ae6c883b4590f909cb881 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Dec 2014 10:08:46 +0100 Subject: [PATCH 4/5] decoder/DsdLib: add missing stdlib.h include --- src/decoder/plugins/DsdLib.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/decoder/plugins/DsdLib.cxx b/src/decoder/plugins/DsdLib.cxx index 0436b9c3f..7321261f6 100644 --- a/src/decoder/plugins/DsdLib.cxx +++ b/src/decoder/plugins/DsdLib.cxx @@ -32,6 +32,7 @@ #include "util/Alloc.hxx" #include +#include #ifdef HAVE_ID3TAG #include From 43da4c0ecaf23ebb7b282bdfe3b5c6bfc3ab6c41 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Dec 2014 20:34:45 +0100 Subject: [PATCH 5/5] input/mms: limit the mmsx_read() size --- NEWS | 2 ++ src/input/plugins/MmsInputPlugin.cxx | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/NEWS b/NEWS index 54e04ab9a..f09d77217 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.19.8 (not yet released) +* input + - mms: reduce delay at the beginning of playback * decoder - dsdiff, dsf: allow ID3 tags larger than 4 kB diff --git a/src/input/plugins/MmsInputPlugin.cxx b/src/input/plugins/MmsInputPlugin.cxx index 1aed9c662..df291bc84 100644 --- a/src/input/plugins/MmsInputPlugin.cxx +++ b/src/input/plugins/MmsInputPlugin.cxx @@ -92,6 +92,13 @@ input_mms_open(const char *url, size_t MmsInputStream::ThreadRead(void *ptr, size_t read_size, Error &error) { + /* unfortunately, mmsx_read() blocks until the whole buffer + has been filled; to avoid big latencies, limit the size of + each chunk we read to a reasonable size */ + constexpr size_t MAX_CHUNK = 16384; + if (read_size > MAX_CHUNK) + read_size = MAX_CHUNK; + int nbytes = mmsx_read(nullptr, mms, (char *)ptr, read_size); if (nbytes <= 0) { if (nbytes < 0)