Skip to content

Return null for unavailable compressed probe images - #457

Open
gregbenz wants to merge 1 commit into
google:mainfrom
gregbenz:codex/null-unavailable-compressed-probe-images
Open

Return null for unavailable compressed probe images#457
gregbenz wants to merge 1 commit into
google:mainfrom
gregbenz:codex/null-unavailable-compressed-probe-images

Conversation

@gregbenz

Copy link
Copy Markdown
Contributor

Return null for unavailable compressed probe images

Summary

  • return nullptr from the compressed base and gain-map getters when probing did not provide a payload
  • preserve existing JPEG behavior when compressed item data is available
  • add public-API coverage for JPEG, HEIF, and AVIF

Why

uhdr_dec_get_base_image() and uhdr_dec_get_gainmap_image() document that they return nullptr when compressed image data is unavailable. HEIF/AVIF probing currently does not populate those compressed payloads, but the getters return a non-null descriptor with data == nullptr and data_sz == 0.

Callers following the documented pointer contract can therefore mistake an unavailable payload for valid compressed data and pass a null data pointer downstream.

This change returns nullptr unless a non-empty compressed payload is present. JPEG probing behavior is unchanged.

Testing

  • verified JPEG probing still returns non-empty compressed base and gain-map payloads
  • verified HEIF and AVIF probes return nullptr for unavailable compressed payloads
  • complete unit suite passes

@google-cla

google-cla Bot commented Aug 18, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gregbenz
gregbenz marked this pull request as ready for review August 18, 2026 19:48
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.

1 participant