LMS-Community / slimserver-vendor

Third-party software used with Lyrion Music Server
https://lyrion.org
42 stars 68 forks source link

Crash when parsing malformed AAC file in faad2 #95

Open retpoline opened 2 years ago

retpoline commented 2 years ago

https://github.com/ralph-irving/faad2/issues/6

ralph-irving commented 2 years ago

As I build new faad binaries I'll upload them to https://sourceforge.net/projects/lmsclients/files/utility/faad/20220205-8cde9ff/ Once complete I'll create a PR for 8.3. However, that will take some time.

ralph-irving commented 2 years ago

@mherger I've created a multarch faad macos binary with m1, x86_64 and i386 platform support. Could you try running it on your m1 and confirm the native build works? I built it on an intel macair, so I can't test it. https://sourceforge.net/projects/lmsclients/files/utility/faad/20220205-8cde9ff/faad-macos/download If it works, I'll create a PR for the updated helpers. Thank you.

mherger commented 2 years ago

Heh... interesting timing: over the weekend I spent some time building a standalone Perl to bundle with LMS for macOS. Got it working on the M1. But it's not a universal binary. I don't know yet how to do universal Perl binaries....

But I was wondering whether we shouldn't try to build universal binaries for the helpers - we currently have two folders for macOS helpers. The old one has universal binaries for PowerPC & Intel... I didn't even know you could cross build on an Intel machine!

% file faad-macos 
faad-macos: Mach-O universal binary with 3 architectures: [i386:Mach-O executable i386] [x86_64:Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64]
faad-macos (for architecture i386): Mach-O executable i386
faad-macos (for architecture x86_64):   Mach-O 64-bit executable x86_64
faad-macos (for architecture arm64):    Mach-O 64-bit executable arm64
% chmod a+x faad-macos 
% ./faad-macos 
 *********** Ahead Software MPEG-4 AAC Decoder V2.7 ******************

 Patched for Squeezebox Server:
 * ALAC decoder integrated
 * Seeking support with -j and -e switches
 * STDIN support
 * utgg win32 STDOUT patch
 * Source at https://github.com/ralph-irving/faad2

 Build: Feb 20 2022
...

Quick smoke test is looking good. Thanks a lot!

ralph-irving commented 2 years ago

Yes it took a few tries but you can build arm64 with XCode 12.2 or higher, but you can't run them. Now I know it works. thanks. I've never built multiarch perl modules for macos but I have for squeezeplay using the gcc-fat.sh scripts but it was never reliable. You could build the x86_64 modules and arm64 modules and use lipo in a script to create new .so files with both architectures. I bundled the faad-macos with lipo -create faad-i386 faad-x86_64 faad-m1 -output faad-macos

I have a 10.6 vm with xcode 3.2 that can still build ppc and ppc64 binaries. My last ppc squeezeplay build has been downloaded only 102 times since July 2021. Were you thinking of dropping power pc support and merging i386, x86_64 and M1 going forward in one folder?

mherger commented 2 years ago

Thanks for the info! Yes, I've been playing with lipo, too (the latest Spotty helper has a universal binary).

Were you thinking of dropping power pc support and merging i386, x86_64 and M1 going forward in one folder?

Yes. PPC is long gone... I didn't even know we had i386 for Mac.

ralph-irving commented 2 years ago

Oh alright. I'll remove i386 from faad before creating the PR and won't include it in any helper binary updates going forward.

mherger commented 2 years ago

FWIW: I removed PPC support and moved everything back to Bin/darwin. I left i386 in, but I believe it's indeed only a few dozen users left, and none on 8.2.0+.

mherger commented 2 years ago

Just to confirm that we can drop support for i386: most of the Perl binaries for 5.18 on Mac are x86_64 only.