faad segfaults on amd64 due to incorrect pointer size
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
faad2 (Debian) |
Fix Released
|
Unknown
|
|||
faad2 (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Lucid |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
When I run faad on amd64 with the command line "faad -b 2 -f 2 -q -w AAC2AC3Temp.aac" (-b 2 indicating 24 bit output), I get a segmentation fault in fwrite. The same command on the same data works fine in a 32 bit system.
The problem is due to the write_audio_24bit() function in frontend/audio.c, which uses a long* pointer (ie which is 8 bytes on amd64 but only 4 on x86):
static int write_audio_
{
int ret;
unsigned int i;
long *sample_buffer24 = (long*)
char *data = malloc(
Changing the definition of sample_buffer24 to make it an int* fixes the problem.
The function write_audio_32bit needs a similar change and stops the segfault happening if you use "-b 3" for 32 bit samples. (There is also similar code in aacDECdrop/audio.c but I'm not sure where that is used.)
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: faad 2.7-4
Uname: Linux 2.6.36-
NonfreeKernelMo
Architecture: amd64
CheckboxSubmission: 1bd8e90541d49b9
CheckboxSystem: d00f84de8a55581
Date: Sun Oct 24 15:21:17 2010
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Alpha amd64 (20100224.1)
ProcEnviron:
LANG=en_AU.utf8
SHELL=/bin/bash
SourcePackage: faad2
Related branches
tags: | added: patch |
tags: | added: patch-forwarded-debian |
Changed in faad2 (Ubuntu): | |
importance: | Undecided → Medium |
Changed in faad2 (Ubuntu): | |
status: | New → Triaged |
tags: | added: patch-forwarded-upstream |
Changed in faad2 (Debian): | |
status: | Unknown → Confirmed |
Changed in faad2 (Debian): | |
status: | Confirmed → Fix Released |
Changed in faad2 (Ubuntu): | |
status: | Triaged → In Progress |
assignee: | nobody → Alessio Treglia (quadrispro) |
Changed in faad2 (Ubuntu Lucid): | |
importance: | Undecided → Medium |
Changed in faad2 (Ubuntu): | |
assignee: | Alessio Treglia (quadrispro) → nobody |
This patch (against faad 2.7 from sourceforge) stops the segfault. I tested it works on a 32 bit platform as well (as it should since int pointers are 4 bytes long on both LP64 and ILP32 platforms).