[
https://issues.apache.org/jira/browse/TIKA-1214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13858299#comment-13858299
]
Stefano Fornari edited comment on TIKA-1214 at 12/29/13 10:18 AM:
------------------------------------------------------------------
This looks like issue TIKA-1179 doesn't it? If so, it is fixed in 1.5-SNAPSHOT
was (Author: stefanofornari):
This looks like issue #1179 doesn't it? If so, it is fixed in 1.5-SNAPSHOT
> Infinity Loop in Mpeg Stream
> ----------------------------
>
> Key: TIKA-1214
> URL: https://issues.apache.org/jira/browse/TIKA-1214
> Project: Tika
> Issue Type: Bug
> Components: parser
> Affects Versions: 1.4
> Environment: local system
> Reporter: Georg Hartmann
> Fix For: 1.5
>
>
> Scanning MP3 Files accounter a infiniy loop in the MpegStream Method
> skipStream
> The Call of in.skip returnes zero so the loop never ends.
> Simple fix with zero count below
> private static void skipStream(InputStream in, long count) throws
> IOException {
> long size = count;
> long skipped = 0;
> // 5 Times zero equals Error break the loop
> int zeroCount = 5;
> while (size > 0 && skipped >= 0) {
> skipped = in.skip(size);
> if (skipped != -1) {
> size -= skipped;
> }
>
> // Checking for zero to break the infinity loop
> if (skipped == 0) {
> zeroCount--;
> }
> if (zeroCount < 0) {
> break;
> }
> }
> }
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)