Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid returning a negative value from Field.get_linelen #638

Merged
merged 1 commit into from
May 1, 2021

Conversation

atsampson
Copy link
Collaborator

@atsampson atsampson commented Apr 30, 2021

A sufficiently messed-up frame (e.g. a player skip) can cause the linelocs list to be non-monotonic. In PAL mode, ld-decode correctly reports the TBC failure, but then crashes because demod_pilot is empty. Fix this by returning the default line length if the length would otherwise be zero or negative.

Example (with -p) on SFTP: adamsampson/Faults/issue638/fawlty-skip.ldf

A sufficiently messed-up frame (e.g. a player skip) can cause the
linelocs list to be non-monotonic. In PAL mode, ld-decode correctly
reports the TBC failure, but then crashes because demod_pilot is empty.

Fix this by returning the default line length if the length would
otherwise be zero or negative.
@atsampson atsampson added enhancement ld-decode An issue only affecting the ld-decode[r] labels Apr 30, 2021
@happycube happycube merged commit f1f5b29 into happycube:master May 1, 2021
@atsampson atsampson deleted the positivelinelen branch May 1, 2021 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ld-decode An issue only affecting the ld-decode[r]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants