aboutsummaryrefslogtreecommitdiffstats
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
parent9e4465cbd1db844461d43df17f699060fbfcfef4 (diff)
downloadmpd-5327a8f421bacb06d2a82b336a2053a8ddb9422b.tar.gz
mpd-5327a8f421bacb06d2a82b336a2053a8ddb9422b.tar.xz
mpd-5327a8f421bacb06d2a82b336a2053a8ddb9422b.zip
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
-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 cdb2a74c0..33087e134 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;