Prevented infinite loop in skipBytes()

This commit is contained in:
daniel oeh 2012-09-22 14:17:22 +02:00
parent 83c363481e
commit ca9fab8330
1 changed files with 3 additions and 0 deletions

View File

@ -101,6 +101,9 @@ public class ID3Reader {
*/ */
protected void skipBytes(InputStream input, int number) throws IOException { protected void skipBytes(InputStream input, int number) throws IOException {
int skipped = 0; int skipped = 0;
if (number <= 0) {
number = 1;
}
while (skipped < number) { while (skipped < number) {
skipped += input.skip(number - skipped); skipped += input.skip(number - skipped);
} }