Skip to content

Fix IndexError on tags with empty values list - #259

Open
devmaiter wants to merge 1 commit into
ianare:developfrom
devmaiter:fix-254-empty-values
Open

Fix IndexError on tags with empty values list#259
devmaiter wants to merge 1 commit into
ianare:developfrom
devmaiter:fix-254-empty-values

Conversation

@devmaiter

Copy link
Copy Markdown

Fixes #254

A tag declaring a single non-ASCII value whose data cannot be read (truncated or corrupted file) leaves the decoded values list empty, and building the printable string crashed with IndexError. Seen in the wild on DJI M3E MakerNote tags.

This guards the zero-index access so the tag decodes to an empty printable instead. Includes a minimal synthetic sample image reproducing the DJI MakerNote case and a regression test; the dump reference is updated accordingly.

A tag declaring a single non-ASCII value whose data cannot be read
(e.g. truncated or corrupted file) leaves the decoded values list
empty, and building the printable string crashed with IndexError.
Seen in the wild on DJI M3E MakerNote tags.

Guard the zero-index access and add a minimal synthetic sample
image reproducing the DJI MakerNote case, with a regression test.
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