Skip to content

fix(rla): terminate the subimage chain and bounds-check the offset table - #5403

Merged
lgritz merged 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-rla
Aug 15, 2026
Merged

fix(rla): terminate the subimage chain and bounds-check the offset table#5403
lgritz merged 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-rla

Conversation

@lgritz

@lgritz lgritz commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

More detection of various creative corruptions.

RLA subimages are concatenated, each header's NextOffset giving the start of the next. Nothing required NextOffset to advance, so a file pointing it at itself or backwards supplied subimages endlessly and any caller enumerating them never terminated. Require it to point past the current header.

seek_subimage() now also gives up its current subimage before overwriting the header and scanline offset table, so failing partway leaves no current subimage rather than a mismatched header, table, and spec.

read_native_scanline() bounds-checks the scanline index against the offset table instead of asserting that the table matches the spec height -- false for field-rendered images, where the height is halved but the table is not.

Assisted-by: Claude Code / Claude Opus 5

RLA subimages are concatenated, each header's NextOffset giving the start
of the next. Nothing required NextOffset to advance, so a file pointing it
at itself or backwards supplied subimages endlessly and any caller
enumerating them never terminated. Require it to point past the current
header.

seek_subimage() now also gives up its current subimage before overwriting
the header and scanline offset table, so failing partway leaves no current
subimage rather than a mismatched header, table, and spec.

read_native_scanline() bounds-checks the scanline index against the offset
table instead of asserting that the table matches the spec height -- false
for field-rendered images, where the height is halved but the table is not.

Assisted-by: Claude Code / Claude Opus 5

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@lgritz
lgritz merged commit 253f89c into AcademySoftwareFoundation:main Aug 15, 2026
30 checks passed
@lgritz
lgritz deleted the lg-rla branch August 15, 2026 17:47
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