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
{{ message }}
Repository navigation
ImageFileReader accepts invalid frame indices #449
ImageFileReader.read_frame_raw() uses index > number_of_frames as its bounds check. This allows negative Python indexing and also misses the first invalid upper-bound value, index == number_of_frames.
Current behavior: the negative index accesses the last offset-table entry, while the upper-bound case fails later through incidental indexing or I/O behavior.
Expected behavior
Valid indices should be exactly 0 <= index < number_of_frames. Invalid indices should raise a clear ValueError before indexing the offset table or seeking into pixel data. read_frame() should inherit the same contract.
Scope
Correct the bounds predicate, document the exception, and add lower- and upper-bound regressions.
Process note
I am filing this issue before the replacement pull request in accordance with the developer guide's issue-first recommendation. PR #434 was opened before that preflight and will be superseded.
Duplicate of #439. A parallel authorized remediation had already created the canonical issue-first record and compliant replacement PR before this batch completed.
Activity
yinkev commentedon Jul 25, 2026
Duplicate of #439. A parallel authorized remediation had already created the canonical issue-first record and compliant replacement PR before this batch completed.