Integrated: JDK-8347377 : Add validation checks for ICC_Profile header fields
Harshitha Onkar
honkar at openjdk.org
Thu Feb 6 18:33:19 UTC 2025
On Fri, 10 Jan 2025 19:06:41 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:
> ICC_Profile.setData(..) does validation of the specified tag contents and throws an exception if it is not valid. But if the tag represents the header, at least some of the validation is lazy, occurring only when the data is used, leading to unexpected exceptions at a later time. The check should be done up-front when the data is set, as in other cases.
>
> `verifyHeader(byte[] data)`is called when header data is being updated and the following fields are validated according to the ICC Spec Document. [[1] Pg#19](https://www.color.org/specification/ICC.1-2022-05.pdf).
>
> - Profile/Device class
> - Color Space
> - Rendering Intent
> - PCS
> - Header Size check (ICC Header Size = 128 bytes)
>
> These validation checks are added to ICC_Profile.getInstance(..) & ICC_Profile.setData(..) methods.
>
> Reference: [1] https://www.color.org/specification/ICC.1-2022-05.pdf
This pull request has now been integrated.
Changeset: ed8945a6
Author: Harshitha Onkar <honkar at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/ed8945a68a67dd51a7cfa332905941afccc12b36
Stats: 327 lines in 4 files changed: 325 ins; 0 del; 2 mod
8347377: Add validation checks for ICC_Profile header fields
Reviewed-by: prr, jdv
-------------
PR: https://git.openjdk.org/jdk/pull/23044
More information about the client-libs-dev
mailing list