You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Nick Burch (Commented) (JIRA)" <ji...@apache.org> on 2011/11/28 01:28:40 UTC

[jira] [Commented] (TIKA-794) Mime magic logic for Little16 is incorrect

    [ https://issues.apache.org/jira/browse/TIKA-794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13158113#comment-13158113 ] 

Nick Burch commented on TIKA-794:
---------------------------------

Bytes reversed in r1206937, which allows CPIO detection to work correctly
                
> Mime magic logic for Little16 is incorrect
> ------------------------------------------
>
>                 Key: TIKA-794
>                 URL: https://issues.apache.org/jira/browse/TIKA-794
>             Project: Tika
>          Issue Type: Bug
>          Components: mime
>    Affects Versions: 1.0
>            Reporter: Nick Burch
>            Assignee: Nick Burch
>             Fix For: 1.1
>
>
> The mime magic logic for big16 and little16 seems to be the same:
>          } else if (type.equals("host16") || type.equals("little16")) {
>              int i = Integer.parseInt(tmpVal, radix);
>              decoded = new byte[] { (byte) (i >> 8), (byte) (i & 0x00FF) };
>          } else if (type.equals("big16")) {
>              int i = Integer.parseInt(tmpVal, radix);
>              decoded = new byte[] { (byte) (i >> 8), (byte) (i & 0x00FF) };
> It looks like both are calculating the big endian version, which is breaking CPIO detection

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira