Attempt to fix buffer overflows with rDNS tags
As asked, I created this PR with a test_reverseDNS.sh script to test adding many rDNS tags to already provided issue-32.mp4.
Without this patch, there are still buffer overflows. Corresponding ASAN report is already uploaded here: https://github.com/wez/atomicparsley/issues/62
FYI, as I am mostly a Mac user, and with latest commit, binary output of rDNS tags appears identical to those generated by tools like Subler or Musicbrainz Picard. Moreover, It also seems ok with freyr-js regarding these comments before replacing AtomicParsley by lofty-rs. Finally, I managed to check that even under Windows, it seems to work too.
Without this patch AtomicParsley on Apple Silicon native corrupts files when using --rDNSatom
% sh redo
Before and after tagging with /tmp/AtomicParsley.brew
197632 -rw-r--r--@ 1 jimmy staff 93658182 8 Jun 09:37 movie.mp4
4196048 -rw-r--r--@ 1 jimmy staff 2148376318 8 Jun 09:37 movie.mp4
Before and after tagging with /tmp/AtomicParsley.arm
182928 -rw-r--r--@ 1 jimmy staff 93658182 8 Jun 09:37 movie.mp4
182664 -rw-r--r--@ 1 jimmy staff 93521292 8 Jun 09:37 movie.mp4
% cat redo
AP1=/tmp/AtomicParsley.brew
AP2=/tmp/AtomicParsley.arm
f=movie.mp4
for AP in "$AP1" "$AP2"
do
cp /tmp/$f .
echo Before and after tagging with $AP
ls -sl $f
$AP "$f" --overWrite --metaEnema --artwork REMOVE_ALL \
--rDNSatom "<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC '-//Apple//DTD PLIST 1.0//EN' 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'>
<plist version='1.0'>
<dict>
<key>cast</key>
<array>
<dict>
<key>name</key>
<string>Peter Pepper</string>
</dict>
</array>
</dict>
</plist>" name="iTun" domain="com.apple.iTunes" \
--stik 'Movie' \
--title 'Diamond' \
--year '2010-03-18-T12:00:00Z' --freefree >/dev/null 2>&1
ls -sl $f
done
Resolved by https://github.com/wez/atomicparsley/pull/71