Your message dated Sat, 21 Mar 2009 19:53:32 +0000
with message-id <[email protected]>
and subject line Bug#506193: fixed in toolame 02l-6lenny1
has caused the Debian Bug report #506193,
regarding toolame: Encoded files are sometimes corrupted (bad 'padding' 
information)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
506193: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=506193
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: toolame
Version: 02l-6
Severity: important
Tags: patch

Hello,

When encoding a mono/16-bit/48kHz WAV file, the resulting file is
sometimes corrupted in the 'padding' information of the headers, which
renders it unplayable by a decoder:

% file test.wav 
test.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 
48000 Hz

% toolame test.wav 
Parsing Wave File Header
>>> 48000 Hz sampling freq selected
>>> Input Wave File is Mono
--------------------------------------------
Input File : 'test.wav'   48.0 kHz
Output File: 'test.mp2'
192 kbps MPEG-1 Layer II single-ch Psycho model=1  (Mode_Extension=0)
[De-emph:Off    Copyright:No    Original:No     CRC:Off]
[Padding:Normal Byte-swap:Off   Chanswap:Off    DAB:Off]
ATH adjustment 0.000000
--------------------------------------------
encode_init: using tablenum 0 with sblimit 27
Hit end of audio data
Avg slots/frame = 576.000; b/smp = 4.00; bitrate = 192.000 kbps

Done

% od -Ax -tx1 test.mp2 | head -1
000000 ff fd a6 c0 55 68 88 87 77 8d f6 b6 22 00 00 ee
             ^^
--> Incorrect (padding is ON)

(...)

% toolame test.wav 
Parsing Wave File Header
>>> 48000 Hz sampling freq selected
>>> Input Wave File is Mono
--------------------------------------------
Input File : 'test.wav'   48.0 kHz
Output File: 'test.mp2'
192 kbps MPEG-1 Layer II single-ch Psycho model=1  (Mode_Extension=0)
[De-emph:Off    Copyright:No    Original:No     CRC:Off]
[Padding:Normal Byte-swap:Off   Chanswap:Off    DAB:Off]
ATH adjustment 0.000000
--------------------------------------------
encode_init: using tablenum 0 with sblimit 27
Hit end of audio data
Avg slots/frame = 576.000; b/smp = 4.00; bitrate = 192.000 kbps

Done

% od -Ax -tx1 test.mp2 | head -1
000000 ff fd a4 c0 55 68 88 87 77 8d f6 b6 22 00 00 ee
             ^^
--> Correct (padding is OFF)

(See for example http://www.mpgedit.org/mpgedit/mpeg_format/mpeghdr.htm
for the header details.)

Tracking this problem down, it appears that the 1-bit 'header->padding'
field is not initialized before parsing the arguments, and if no
argument changes this field, it is left unitialized, resulting in a
possible corruption.

The attached patch initializes the field to 0 before parsing the
arguments.

It seems that the problem does not appear with the (more common) 44.1
kHz sampling rate. My guess, after browsing through the source, is that
in that case, sizes of packets are such that the encoder has to set the
padding field for each packet, whereas with 48 kHz, all packets are the
same size, and the encoder uses the unitialized value throughout the
whole output file.

By the way, I recently became aware of the 'twolame' package, which
is a fork of 'toolame'. A quick test with it seems to show that this bug
(as well as the previous one I reported, #504308) is not present in
it. Should 'toolame' then be considered obsoleted by 'twolame'?

Thanks and 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.27.6-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-16     GNU C Library: Shared libraries

toolame recommends no packages.

toolame suggests no packages.

-- no debconf information
diff -ru toolame-02l.orig/toolame.c toolame-02l/toolame.c
--- toolame-02l.orig/toolame.c	2008-11-02 19:01:25.000000000 +0100
+++ toolame-02l/toolame.c	2008-11-15 10:15:00.000000000 +0100
@@ -644,6 +644,7 @@
   inPath[0] = '\0';
   outPath[0] = '\0';
   header->lay = DFLT_LAY;
+  header->padding = 0;
   switch (DFLT_MOD) {
   case 's':
     header->mode = MPG_MD_STEREO;
Binary files toolame-02l.orig/toolame.o and toolame-02l/toolame.o differ

--- End Message ---
--- Begin Message ---
Source: toolame
Source-Version: 02l-6lenny1

We believe that the bug you reported is fixed in the latest version of
toolame, which is due to be installed in the Debian FTP archive:

toolame_02l-6lenny1.diff.gz
  to pool/main/t/toolame/toolame_02l-6lenny1.diff.gz
toolame_02l-6lenny1.dsc
  to pool/main/t/toolame/toolame_02l-6lenny1.dsc
toolame_02l-6lenny1_i386.deb
  to pool/main/t/toolame/toolame_02l-6lenny1_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Fabian Greffrath <[email protected]> (supplier of updated toolame 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 16 Mar 2009 14:35:12 +0100
Source: toolame
Binary: toolame
Architecture: source i386
Version: 02l-6lenny1
Distribution: stable
Urgency: low
Maintainer: Debian multimedia packages maintainers 
<[email protected]>
Changed-By: Fabian Greffrath <[email protected]>
Description: 
 toolame    - MPEG-1 layer 2 audio encoder
Closes: 504308 506193
Changes: 
 toolame (02l-6lenny1) stable; urgency=low
 .
   * debian/control:
     + Added Build-Depends on quilt.
     + Bumped Standards-Version to 3.8.0.
     + Removed the "XS-" prefix from the Vcs-Svn and Vcs-Browser fields.
     + Added Homepage field and removed it from the package description.
     + Fixed "binary-control-field-duplicates-source field".
   * debian/rules:
     + Included quilt for patch management.
     + Fixed "debian-rules-ignores-make-clean-error".
   * debian/patches/01-WAV-header-read-incorrectly-on-64-bit-platforms.patch:
     + New patch to fix usage of "unsigned long" on 64-bit little-endian
       platforms (Closes: #504308).
     + Thanks Christian Grigis <[email protected]>!
   * 
debian/patches/02-initialize-header-padding-field-before-parsing-arguments.patch:
     + New patch to initialize the 1-bit 'header->padding' field before parsing
       the arguments (Closes: #506193).
     + Thanks Christian Grigis <[email protected]>!
Checksums-Sha1: 
 85f319a7d22105d1829c5162aa80ca747023c4c2 1444 toolame_02l-6lenny1.dsc
 2a7f1dd2fa5e99e5ae9e4944e67ebfdf086a98e8 6118 toolame_02l-6lenny1.diff.gz
 213f1bf82787afb6f61f7f4fed54ebae0a71deb4 91862 toolame_02l-6lenny1_i386.deb
Checksums-Sha256: 
 d1e22b7170597bace4f803ed3fe2e56c1ab542ddecaf7f6a7f16dee7d1034e39 1444 
toolame_02l-6lenny1.dsc
 9f9d42298e2a74e2c2b1393993f1f6af5dc29381e216ebb25f989dd8fe907233 6118 
toolame_02l-6lenny1.diff.gz
 f0a37c99480c2dcd9b4a8d150d25ff68cdf80eeff480594013c601bf07844164 91862 
toolame_02l-6lenny1_i386.deb
Files: 
 cda80803b5d2583950eb130ea2d580e2 1444 sound optional toolame_02l-6lenny1.dsc
 180c63411cc1c9d7479d2dbf2d0fba37 6118 sound optional 
toolame_02l-6lenny1.diff.gz
 9001994b86898cc3e7fd0dfe1c0d1528 91862 sound optional 
toolame_02l-6lenny1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Debian Powered!

iJwEAQECAAYFAknAnKwACgkQ78RAoABp8o+chAP9FYCUk3R16yKLLJEpPohK9PKA
8f6c+7toChjQUr3ROx5PDLLJ91uz40/+x5Skf7/ZkMcIQfM7ZIxPl6I56P3BFQfA
Cn/Q3XE6p+Qwf6q3inLjNbTImFhQUJNFiw79WvHRdTtphh7DrFJX4iZMxHyFL1tr
GKZPvO/4uVcbz3hNLj4=
=urfT
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to