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

Crash when parsing malformed AAC file in faad2 #95

Open
retpoline opened this issue Feb 3, 2022 · 8 comments
Open

Crash when parsing malformed AAC file in faad2 #95

retpoline opened this issue Feb 3, 2022 · 8 comments

Comments

@retpoline
Copy link

ralph-irving/faad2#6

@ralph-irving
Copy link
Contributor

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
Copy link
Contributor

@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
Copy link
Contributor

mherger commented Feb 21, 2022

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
Copy link
Contributor

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
Copy link
Contributor

mherger commented Feb 21, 2022

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
Copy link
Contributor

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
Copy link
Contributor

mherger commented Feb 21, 2022

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
Copy link
Contributor

mherger commented Feb 21, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants