aboutsummaryrefslogtreecommitdiff
path: root/src/inputPlugins
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2005-02-14 00:52:29 +0000
committerWarren Dukes <warren.dukes@gmail.com>2005-02-14 00:52:29 +0000
commit5327a8f421bacb06d2a82b336a2053a8ddb9422b (patch)
treedba301951acd31992ab7243229e81ac190ce8289 /src/inputPlugins
parent9e4465cbd1db844461d43df17f699060fbfcfef4 (diff)
when filling mp3 buffer, check if its already full. If it is, then give up trying to read in a potential mp3 frame, cause no mp3 frame should be bigger than the input buffer
git-svn-id: https://svn.musicpd.org/mpd/trunk@2950 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/inputPlugins')
-rw-r--r--src/inputPlugins/mp3_plugin.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c
index cdb2a74c..33087e13 100644
--- a/src/inputPlugins/mp3_plugin.c
+++ b/src/inputPlugins/mp3_plugin.c
@@ -187,6 +187,10 @@ int fillMp3InputBuffer(mp3DecodeData * data) {
remaining = 0;
}
+ /* we've exhausted the read buffer, so give up!, these potential
+ * mp3 frames are way too big, and thus unlikely to be mp3 frames */
+ if(readSize == 0) return -1;
+
readed = readFromInputStream(data->inStream, readStart, (size_t)1,
readSize);
if(readed <= 0 && inputStreamAtEOF(data->inStream)) return -1;