[ 
https://issues.apache.org/jira/browse/TIKA-1214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jukka Zitting resolved TIKA-1214.
---------------------------------

       Resolution: Duplicate
    Fix Version/s:     (was: 1.5)

Resolving as duplicate of TIKA-1179. Please reopen, preferably with a test 
case/document, if this problem still occurs.

> 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
>
> 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)

Reply via email to