Skip to content

UB nan outside range at iccApplyProfiles.cpp:560 #646

@xsscx

Description

@xsscx

Maintainer Repro

2026-03-06 02:43:39 UTC

Host

5f7e03a (HEAD -> master, origin/master, origin/HEAD) Add link to ICC Intellectual Property Policy in CONTRIBUTING (#643)

PoC Replay

Step 1. wget https://github.com/xsscx/fuzz/raw/refs/heads/master/graphics/icc/ub-nan-outside-range-iccApplyProfiles_cpp-Line560.icc

Step 2. wget https://github.com/xsscx/fuzz/raw/refs/heads/master/graphics/tif/test_rgb.tif

Step 3. ASAN_OPTIONS=detect_leaks=0 iccApplyProfiles test_rgb.tif ub-out.tif 1 0 0 0 0 ub-nan-outside-range-iccApplyProfiles_cpp-Line560.icc 0

PoC Expected Output

ASAN_OPTIONS=detect_leaks=0 iccApplyProfiles /tmp/test_rgb.tif /tmp/ub-out.tif 1 0 0 0 0 ub-nan-outside-range-iccApplyProfiles_cpp-Line560.icc 0
Tools/CmdLine/IccApplyProfiles/iccApplyProfiles.cpp:560:39: runtime error: -nan is outside the range of representable values of type 'unsigned char'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Tools/CmdLine/IccApplyProfiles/iccApplyProfiles.cpp:560:39

test_rgb.tif

Metadata

Metadata

Assignees

Labels

BugBug ReportTriagedMaintainer indicates triaged status and ready for developer handofflibFuzzerlibFuzzer Related

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions