Skip to content

Conversation

Copy link

Copilot AI commented Nov 21, 2025

Clarified behavior when PFM files are corrupted (smaller than header-declared dimensions).

Current behavior

The per-pixel file.fail() check (line 102) detects truncated files immediately:

  • file.read() sets fail bit when reading beyond EOF
  • Exception thrown on first incomplete read: "invalid PFM image: error reading pixel data"
  • Image buffer abandoned before any out-of-bounds writes

No code changes needed - the implementation correctly prevents undefined behavior from corrupted files.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix handling of corrupted PFM files in image loaders Address review question on corrupted PFM file handling Nov 21, 2025
Copilot AI requested a review from kraszkow November 21, 2025 17:42
@kraszkow kraszkow closed this Nov 25, 2025
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.

2 participants