aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-21 12:52:27 +0200
committerMax Kellermann <max@duempel.org>2014-08-21 12:52:27 +0200
commit455fd180b124844f567e25ba8e8884be9b6fa145 (patch)
treecb1e930e67565cb93ab565e044f9411213523bf1
parente6177c3349b772489040caa5ac23860c7010c9c4 (diff)
parent78abcd7df7ad967c44c884773cc7d39cf3c811a9 (diff)
downloadmpd-455fd180b124844f567e25ba8e8884be9b6fa145.tar.gz
mpd-455fd180b124844f567e25ba8e8884be9b6fa145.tar.xz
mpd-455fd180b124844f567e25ba8e8884be9b6fa145.zip
Merge branch 'v0.18.x'
-rw-r--r--NEWS1
-rw-r--r--src/decoder/plugins/DsdiffDecoderPlugin.cxx2
-rw-r--r--src/decoder/plugins/DsfDecoderPlugin.cxx2
3 files changed, 3 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 6cf8956cc..c5c10ca85 100644
--- a/NEWS
+++ b/NEWS
@@ -63,6 +63,7 @@ ver 0.19 (not yet released)
ver 0.18.13 (not yet released)
* decoder
+ - dsdiff, dsf: fix endless loop on malformed file
- ffmpeg: support ffmpeg/libav version 11
ver 0.18.12 (2014/07/30)
diff --git a/src/decoder/plugins/DsdiffDecoderPlugin.cxx b/src/decoder/plugins/DsdiffDecoderPlugin.cxx
index 7288d4142..941cfbc7b 100644
--- a/src/decoder/plugins/DsdiffDecoderPlugin.cxx
+++ b/src/decoder/plugins/DsdiffDecoderPlugin.cxx
@@ -366,7 +366,7 @@ dsdiff_decode_chunk(Decoder &decoder, InputStream &is,
const unsigned buffer_samples = buffer_frames * frame_size;
const size_t buffer_size = buffer_samples * sample_size;
- while (chunk_size > 0) {
+ while (chunk_size >= frame_size) {
/* see how much aligned data from the remaining chunk
fits into the local buffer */
size_t now_size = buffer_size;
diff --git a/src/decoder/plugins/DsfDecoderPlugin.cxx b/src/decoder/plugins/DsfDecoderPlugin.cxx
index f3554218b..b4f90b15b 100644
--- a/src/decoder/plugins/DsfDecoderPlugin.cxx
+++ b/src/decoder/plugins/DsfDecoderPlugin.cxx
@@ -232,7 +232,7 @@ dsf_decode_chunk(Decoder &decoder, InputStream &is,
const unsigned buffer_samples = buffer_frames * frame_size;
const size_t buffer_size = buffer_samples * sample_size;
- while (chunk_size > 0) {
+ while (chunk_size >= frame_size) {
/* see how much aligned data from the remaining chunk
fits into the local buffer */
size_t now_size = buffer_size;