-
Notifications
You must be signed in to change notification settings - Fork 70
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
rDNS is broken in latest Windows release (only tested with binaries) #66
Comments
Thanks for filing an issue! Please note that this project is only passively maintained, so your best bet for getting an issue resolved is through a pull request that is easy to verify! Please read this for more information. |
This issue is not isolated to Windows; it shows up in macOS builds as well. The root cause seems to be the changes in d86a31a. Reverting just this change fixes the problem for me in local builds. The issue seems to be that when writing, Lines 3502 to 3510 in 171e8ae
... but when reading (in the call to Lines 1818 to 1829 in 171e8ae
... the code expects a fixed 12-byte amount. I know essentially nothing about the low-level format of atoms within an mp4 file, but the actual contents of the variable-length rdns name are written as part of the data of the Lines 3515 to 3516 in 171e8ae
... is the thing that actually encodes the data portion of the atom. It already adjusts Put simply, I believe the |
This reverts commit d86a31a. This change does not seem to be correct. See discussion: wez#66 (comment) The `12` was related to a fixed-size header and not related to the length of the variable-length rdns name. That length is encoded in the data part of the atom, in the call to `APar_atom_Binary_Put`.
Hm. I'm reading through #62 (and #44) and I don't think the proposed fix in #71 is quite right. Based on the way the reading code works, it seems to expect a 12-byte header in the atom and the actual rdns name should come after. I still can't account for why the original code triggered an ASAN error. |
OK, the source of the 12 here is that the name atom is a "full atom". These include the usual 4-byte size, the 4-byte type code ( The writing side of this is a mess. Reverting the changes in d86a31a isn't enough. The trouble is that Line 2386 in 171e8ae
When binary data is appended to the atom, This is why the code prior to d86a31a worked for On the other hand, Lines 2389 to 2394 in 171e8ae
This is why d86a31a makes longer names succeed. Writes via However, this isn't correct either: if you write a 20-byte name, the resulting Interestingly, Lines 2678 to 2687 in 171e8ae
... but this isn't related to the size of the buffer at all: The cheapest fix is therefore to just allocate the Lines 3274 to 3279 in 171e8ae
Then the existing length check will just do its job. We'll waste ~3 KB of RAM for each reverse DNS name (in the "----", "mean", and "name" atoms) but we won't have to update all 11 sites that allocate or reassign the |
Fixes wez#66. See extensive discussion there.
This reverts commit d86a31a. This change does not seem to be correct. See discussion: #66 (comment) The `12` was related to a fixed-size header and not related to the length of the variable-length rdns name. That length is encoded in the data part of the atom, in the call to `APar_atom_Binary_Put`.
rDNS tagging seems to be broken in latest Windows release. Starting with a blank input file or wiping any existing metadata in it before writing rDNS does not make a difference, and neither does writing in place or to temp output.
For example:
AtomicParsley.exe Test.m4a --preserveTime --metaEnema
AtomicParsley.exe Test.m4a --preserveTime --rDNSatom " 00001BAB 00001CB3 000093C6 00009D77 0001145F 0001E1B9 00007C14 00007A19 000188D6 0001BB5B" name=iTunNORM domain=com.apple.iTunes
writes metadata to
iTun
"atom" on domaincom.apple.iTunes
Testing with
AtomicParsley.exe Test.m4a -t
yields:Atom "----" [com.apple.iTunes;iTun] contains: 00001BAB 00001CB3 000093C6 00009D77 0001145F 0001E1B9 00007C14 00007A19 000188D6 0001BB5B
Some quick tests show that anything beyond the first 4 chars of the atom name are being truncated. Even worse, repeating the process ends up with multiple
iTun
"atoms".EDIT 1: Running Windows 64-bit, tested with both AP 32 and 64. Same issue.
EDIT 2: I can confirm that this regression seems to have been introduced with the 2022 release. The 20210715.151551.e7ad03a release works as expected.
The text was updated successfully, but these errors were encountered: