-
Notifications
You must be signed in to change notification settings - Fork 14
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: stop adding unnecessary null terminators to strings #172
Conversation
Looks like some tests aren't updated |
I'm happy to go through and update more tests, do you have any feedback on the change itself though? |
I think the change itself is reasonable |
81de5ef
to
85eb603
Compare
@at-wat Sorry for the long delay here but I think I've fixed the broken test, at least |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #172 +/- ##
=======================================
Coverage 99.25% 99.25%
=======================================
Files 24 24
Lines 1886 1886
=======================================
Hits 1872 1872
Misses 9 9
Partials 5 5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
When using this project with AWS Kinesis Video, Kinesis Video fails to parse the CodecID field of an MKV TrackEntry due to the fact that this package guarantees that strings will always have null terminators.
According to the EBML spec, null termination is allowed but not recommended except in the case where a field is being overwritten in place, such that the subsequent data in a string value can be ignored without fully overwriting it (in case the field is very large for example).
https://www.rfc-editor.org/rfc/rfc8794.html#terminating-elements
While the behavior in this package is technically correct, for better compatibility it is advisable not to null terminate strings unless absolutely necessary.