[
https://issues.apache.org/jira/browse/IMAGING-248?focusedWorklogId=374349&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-374349
]
ASF GitHub Bot logged work on IMAGING-248:
------------------------------------------
Author: ASF GitHub Bot
Created on: 19/Jan/20 20:38
Start Date: 19/Jan/20 20:38
Worklog Time Spent: 10m
Work Description: kinow commented on pull request #37: [IMAGING-248]:
ICNS: missing element types; some safety checks
URL: https://github.com/apache/commons-imaging/pull/37#discussion_r368320786
##########
File path:
src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java
##########
@@ -195,19 +195,14 @@ public void dump(final PrintWriter pw) {
}
}
- private IcnsElement readIcnsElement(final InputStream is) throws
IOException {
- final int type = read4Bytes("Type", is, "Not a Valid ICNS File",
getByteOrder()); // Icon type
- // (4
bytes)
- final int elementSize = read4Bytes("ElementSize", is, "Not a Valid
ICNS File", getByteOrder()); // Length
-
// of
-
// data
-
// (4
-
// bytes),
-
// in
-
// bytes,
-
// including
-
// this
-
// header
+ private IcnsElement readIcnsElement(final InputStream is, final int
remainingSize) throws IOException {
+ // Icon type (4 bytes)
+ final int type = read4Bytes("Type", is, "Not a Valid ICNS File",
getByteOrder());
+ // Length of data (4 bytes), in bytes, including this header
+ final int elementSize = read4Bytes("ElementSize", is, "Not a Valid
ICNS File", getByteOrder());
+ if (elementSize > remainingSize) {
Review comment:
The `groovy.icns` file mentioned in the PR fails to parse here 🤔 resulting
in an exception
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 374349)
Time Spent: 20m (was: 10m)
> ICNS: missing element types; some safety checks
> -----------------------------------------------
>
> Key: IMAGING-248
> URL: https://issues.apache.org/jira/browse/IMAGING-248
> Project: Commons Imaging
> Issue Type: Improvement
> Components: Format: ICNS
> Affects Versions: 1.0-alpha1
> Reporter: Bruno P. Kinoshita
> Assignee: Bruno P. Kinoshita
> Priority: Minor
> Fix For: 1.0-alpha2
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Placeholder for https://github.com/apache/commons-imaging/pull/37/
--
This message was sent by Atlassian Jira
(v8.3.4#803005)