jmestwa-coder commented on code in PR #1045:
URL: https://github.com/apache/poi/pull/1045#discussion_r3053242617
##########
poi-scratchpad/src/main/java/org/apache/poi/hwmf/record/HwmfPlaceableHeader.java:
##########
@@ -54,7 +55,10 @@ protected HwmfPlaceableHeader(LittleEndianInputStream leis)
throws IOException {
* Thus, a value of 720 specifies that the image SHOULD be rendered at
twice its normal size,
* and a value of 2880 specifies that the image SHOULD be rendered at
half its normal size.
*/
- unitsPerInch = leis.readShort();
+ unitsPerInch = leis.readUShort();
+ if (unitsPerInch == 0) {
+ throw new RecordFormatException("Invalid WMF placeable header
unitsPerInch: " + unitsPerInch);
Review Comment:
I’ve updated the constructor signature to explicitly declare
RecordFormatException for consistency with the parsing 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]