You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/09/20 19:51:41 UTC
[PR] [bug-69924] HwmfHeader: reject an invalid metafile type instead of throwing ArrayIndexOutOfBoundsException [poi]
pjfanning opened a new pull request, #1333:
URL: https://github.com/apache/poi/pull/1333
Fixes https://bz.apache.org/bugzilla/show_bug.cgi?id=69924
`HwmfHeader` used the 16-bit header type as an index into `HwmfHeaderMetaType.values()` without a range check, so a file that is not a WMF (the attached one starts with `0xF600`) failed with `ArrayIndexOutOfBoundsException: Index 62975 out of bounds for length 2`.
It now throws `IOException("Not a valid WMF header. Type: 0xf600")` — a checked exception, as the reporter asked for, and the same kind `HemfHeader` throws for an invalid EMF header and `HwmfPicture` for an unknown record type.
The attached file is added as `test-data/slideshow/bug69924.wmf` with a regression test in `TestHwmfParsing` and the matching entry in `poi-integration-exceptions.csv`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: [PR] [bug-69924] HwmfHeader: reject an invalid metafile type instead of throwing ArrayIndexOutOfBoundsException [poi]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #1333:
URL: https://github.com/apache/poi/pull/1333
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org