Skip to content

Fix Nikon video record and Picture Control decoding - #9534

Open
wilx wants to merge 3 commits into
Exiv2:mainfrom
wilx:fix-nikon-video-metadata
Open

wilx wants to merge 3 commits into
Exiv2:mainfrom
wilx:fix-nikon-video-metadata

Conversation

@wilx

@wilx wilx commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #3166.

PR #3426 already fixed the original corruption exception. This addresses the false Nikon length errors and incorrect Picture Control text in the tested Z6 III and Z8 MP4 samples.

  • Validate NCTG record boundaries, correct signed SHORT decoding, and preserve descriptive lens names.
  • Decode Picture Control families 01/02/03 using their respective layouts, preserving legacy output and omitting unverified modern controls.

Tested both camera samples, synthetic regressions, focused ASan/UBSan checks, and the full debug CTest suite (8/8). Also verified no-XMP, BMFF-disabled, video-disabled, and Meson builds on Linux x86-64.

AI assistance: OpenAI Codex was used to develop and review these changes.

Comment thread src/quicktimevideo.cpp Fixed
Comment thread src/quicktimevideo.cpp Fixed
@wilx
wilx force-pushed the fix-nikon-video-metadata branch from 71e56a8 to 22bcb33 Compare November 4, 2026 22:31
wilx added 3 commits November 22, 2026 16:24
Parse NCTG records within their declared payload boundaries using full-width
length calculations. Decode signed SHORT components correctly, skip unmapped
records by their validated extent, and preserve descriptive lens names.

Add unit and CLI regressions for signed values, malformed records, and record
and atom boundaries.

Refs Exiv2#3166
Select the family 01, 02, and 03 layouts before reading Picture Control fields.
Preserve legacy output and decode modern names, bases, and adjustment modes
without applying unverified legacy offsets.

Validate version strings and field boundaries, clear obsolete Picture Control
values when a later record replaces them, and add modern-layout regressions.

Fixes Exiv2#3166
Replace Nikon NCTG width-table subscripts with std::array::at() to address the CodeQL review findings. Keep the existing type validation and record bounds.
@wilx
wilx force-pushed the fix-nikon-video-metadata branch from 22bcb33 to 5716679 Compare November 22, 2026 15:24
@mergify

mergify Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request once it meets the queue conditions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nikon Z *

2 participants