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
This commit is contained in:
Warren Dukes 2005-02-14 00:52:29 +00:00
parent 9e4465cbd1
commit 5327a8f421
1 changed files with 4 additions and 0 deletions

View File

@ -187,6 +187,10 @@ int fillMp3InputBuffer(mp3DecodeData * data) {
remaining = 0; 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, readed = readFromInputStream(data->inStream, readStart, (size_t)1,
readSize); readSize);
if(readed <= 0 && inputStreamAtEOF(data->inStream)) return -1; if(readed <= 0 && inputStreamAtEOF(data->inStream)) return -1;