You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2017/02/01 21:11:01 UTC

[Bug 60677] New: Invalid substring range in WMF draw

https://bz.apache.org/bugzilla/show_bug.cgi?id=60677

            Bug ID: 60677
           Summary: Invalid substring range in WMF draw
           Product: POI
           Version: 3.16-dev
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
          Assignee: dev@poi.apache.org
          Reporter: tallison@mitre.org
  Target Milestone: ---

Created attachment 34707
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34707&action=edit
Triggering file

Dominik Stadler's recent regression tests identified an invalid substring range
exception triggered by WMF's drawString.

I extracted the triggering wmf from the file in Dominik's regression corpus,
and I'm attaching it here.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60677] Invalid substring range in WMF drawString

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60677

Tim Allison <ta...@mitre.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Tim Allison <ta...@mitre.org> ---
Doh, forgot to close out this issue.  Committed in r1781593.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60677] Invalid substring range in WMF drawString

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60677

Tim Allison <ta...@mitre.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
            Summary|Invalid substring range in  |Invalid substring range in
                   |WMF draw                    |WMF drawString

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60677] Invalid substring range in WMF drawString

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60677

--- Comment #1 from Tim Allison <ta...@mitre.org> ---
This was caused by my change to byte[] from String.

For multibyte encodings (e.g. Shift_JIS), things get interesting.

The byte length might not equal the string length().

The x information is stored in dx[], an array parallel to the
byte array text[].  dx[] stores x position in the
first byte of a multibyte character, but 0 for the other bytes
in that character.

We need to map this information to the String offsets
          dx[0] = 13 text[0] = -125
          dx[1] = 0  text[1] = 118
          dx[2] = 14 text[2] = -125
          dx[3] = 0  text[3] = -115

 needs to be remapped as:
          dxNormed[0] = 13 textString.get(0) = U+30D7
          dxNormed[1] = 14 textString.get(1) = U+30ED


I have a patch ready, and I'll apply it once 3.16-beta2 is released.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60677] Invalid substring range in WMF drawString

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60677

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|PatchAvailable              |

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60677] Invalid substring range in WMF drawString

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60677

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org