[
https://issues.apache.org/jira/browse/TIKA-1214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13855530#comment-13855530
]
Nick Burch commented on TIKA-1214:
----------------------------------
Can you try with a recent nightly build? We've done a mpeg related fix fairly
recently (the number escapes me right now), so it'd be worth checking to see if
it's already fixed or not
> 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)