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

fix integer overflow when ctts contains entries with negative offsets #14

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Nov 12, 2024

Fixes a debug crash with this video.
See

@Wumpf Wumpf added bug Something isn't working include in changelog Will appear in CHANGELOG.md labels Nov 12, 2024
Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the video have a freeze-frame at the ends with an infinite duration or something? O.o

@Wumpf
Copy link
Member Author

Wumpf commented Nov 12, 2024

that's not what CTTS sample offsets mean, no
I'm not familiar with the details, but they determine how DTS & CTS/PTS are computed

@Wumpf
Copy link
Member Author

Wumpf commented Nov 12, 2024

sample_offset is an i32 to begin with

@Wumpf
Copy link
Member Author

Wumpf commented Nov 12, 2024

ah yeah it can definitely be negative. So our cast there to i64 was wrong
https://developer.apple.com/documentation/quicktime-file-format/composition_offset_atom

that's for MOV, but surely holds up for MP4 as well I'd guess

@Wumpf Wumpf merged commit 2a95457 into main Nov 12, 2024
7 of 9 checks passed
@emilk
Copy link
Member

emilk commented Nov 12, 2024

Can the sample_delta above also be signed? Maybe we should vet all as u64?

@Wumpf
Copy link
Member Author

Wumpf commented Nov 12, 2024

👍 I'll have a quick pass, but I don't want to divulge into more spec reading right now....

@Wumpf Wumpf deleted the andreas/handle-negative-offsets-in-ctts branch November 12, 2024 10:49
@Wumpf Wumpf mentioned this pull request Nov 12, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working include in changelog Will appear in CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants