Skip to content

Conversation

@mstoeckl
Copy link
Contributor

@mstoeckl mstoeckl commented Jan 9, 2026

This is an alternative to #2713 in limiting the amount of memory allocated by the .hdr file decoder. This approach sets a hard limit on the maximum length of the image header, thereby limiting the amount of memory the decoder could allocate to parse and store the header's contents. If there ever are HDR files which have very long headers, it would not be difficult to explicitly configure limits, like #2713, instead.

The Radiance HDR decoder retains a decoded form of the complete image
header; imposing a generous hard limit on the header length ensures
that the decoder will never allocate an extreme amount of memory, while
being unlikely to reject any but pathological images.
The decoder allocates a temporary buffer to hold a scanline; this could
increase the required decoding space by a significant fraction if the
image has height 1 and very large width.
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