You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add bounds checks and extend XMP namespace handling
Add numerous safety checks, new XMP namespace constants, and extended XMP->portable mapping/parsing.
Key changes:
- Introduce JPEG/TIFF size limits and helper functions (kMaxJpegSegmentPayload, jpeg_segment_length_u16, set_jpeg_segment_limit_error, append_jpeg_segment) and enforce payload limits when emitting/compiling JPEG segments and building C2PA sign requests.
- Replace unchecked arithmetic with checked helpers (ifd_directory_size_bytes_checked, checked_u32_add, checked_u32_add_size, checked_align_to_2) to avoid integer overflow when computing IFD and data cursor sizes; enforce max TIFF/EXIF bytes.
- Add many new XMP namespace constants and prefix mappings in xmp_decode/xmp_dump (stDim, stEvt, stFnt, stJob, stMfs, stRef, stVer, xmpBJ, xmpDM, xmpTPg, xmpG, etc.) and update portable property/shape logic accordingly.
- Add new parsing/resolution helpers for qualified and indexed structured XMP property names (resolve_qualified_xmp_property_name, resolve_existing_xmp_component_to_portable, parse_indexed_structured_indexed_nested_xmp_property_name) and new PortableIndexedStructuredIndexedNestedProperty struct plus related promotions and shape rules.
- Improve bounds checks in maker-note decoders and container scanner (Nikon, Olympus, Sony, container_scan) to guard against small/invalid inputs and large entry counts/offsets.
- Tighten checks when copying/patching TIFF data and when validating value offsets to prevent out-of-range accesses.
These changes harden parsing/emission code against malformed or malicious inputs and expand XMP handling for additional structured/qualified fields.
0 commit comments