Bug#504308: toolame: WAV header read incorrectly on 64-bit platforms
Christian Grigis
glove at grigri.org
Sun Nov 2 18:28:25 UTC 2008
Package: toolame
Version: 02l-6
Severity: important
Tags: patch
When reading the sample frequency of the WAV header (a 32-bit
value), a pointer to an "unsigned long" is used on little-endian
platforms. Unfortunately, "unsigned long" is 64-bit on 64-bit platforms:
% file audio.wav
audio.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 48000 Hz
% toolame -s 48 audio.wav
Parsing Wave File Header
>>> Unknown samp freq 824633720880000 Hz in Wave Header
>>> Default 44.1 kHz samp freq selected
>>> Input Wave File is Stereo
--------------------------------------------
Input File : 'audio.wav' 44.1 kHz
Output File: 'audio.mp2'
192 kbps MPEG-1 Layer II j-stereo Psy model 1
[De-emph:Off Copyright:No Original:No CRC:Off]
[Padding:Normal Byte-swap:Off Chanswap:Off DAB:Off]
ATH adjustment 0.000000
--------------------------------------------
(...)
(note that 824633720880000 & 0xFFFFFFFF == 48000)
I patched it using a uint32_t to be sure of the length:
% ./toolame-02l/toolame -s 48 audio.wav
Parsing Wave File Header
>>> 48000 Hz sampling freq selected
>>> Input Wave File is Stereo
--------------------------------------------
Input File : 'audio.wav' 48.0 kHz
Output File: 'audio.mp2'
192 kbps MPEG-1 Layer II j-stereo Psy model 1
[De-emph:Off Copyright:No Original:No CRC:Off]
[Padding:Normal Byte-swap:Off Chanswap:Off DAB:Off]
ATH adjustment 0.000000
--------------------------------------------
(...)
Best regards,
-Christian
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.26.5-mooch.1-amd64 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF8)
Shell: /bin/sh linked to /bin/bash
Versions of packages toolame depends on:
ii libc6 2.7-15 GNU C Library: Shared libraries
toolame recommends no packages.
toolame suggests no packages.
-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-diff
Size: 670 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20081102/aea21e51/attachment.diff
More information about the pkg-multimedia-maintainers
mailing list