Package: sox
Version: 14.0.0-5
Severity: normal
Tags: patch

Hi,

The attached patch fixes a crash on 64-bit architectures with key and
tempo effects. Strictly speaking only the fix to tempo.c should be
necessary, but since other warnings were caused about pointer
incompatibility and I had to inspect them, I decided to fix them too.

        Sami


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.23.12-sli (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=C, [EMAIL PROTECTED] (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash

Versions of packages sox depends on:
ii  libc6                         2.7-6      GNU C Library: Shared libraries
ii  libltdl3                      1.5.24-2   A system independent dlopen wrappe
ii  libsamplerate0                0.1.2-5    audio rate conversion library
ii  libsox0                       14.0.0-5   SoX library

Versions of packages sox recommends:
ii  libsox-fmt-alsa               14.0.0-5   SoX alsa format I/O library
ii  libsox-fmt-ao                 14.0.0-5   SoX Libao format I/O library
ii  libsox-fmt-base               14.0.0-5   Minimal set of SoX format librarie
ii  libsox-fmt-oss                14.0.0-5   SoX OSS format I/O library

-- no debconf information
diff -urb sox-14.0.0/src/flac.c sox-debug/src/flac.c
--- sox-14.0.0/src/flac.c	2007-09-02 20:57:37.000000000 +0300
+++ sox-debug/src/flac.c	2008-01-17 17:31:41.000000000 +0200
@@ -255,7 +255,7 @@
 
 
 
-static FLAC__StreamEncoderWriteStatus flac_stream_encoder_write_callback(FLAC__StreamEncoder const * const flac, const FLAC__byte buffer[], unsigned const bytes, unsigned const samples, unsigned const current_frame, void * const client_data)
+static FLAC__StreamEncoderWriteStatus flac_stream_encoder_write_callback(FLAC__StreamEncoder const * const flac, const FLAC__byte buffer[], const size_t bytes, unsigned const samples, unsigned const current_frame, void * const client_data)
 {
   sox_format_t * const ft = (sox_format_t *) client_data;
   (void) flac, (void) samples, (void) current_frame;
diff -urb sox-14.0.0/src/mp3.c sox-debug/src/mp3.c
--- sox-14.0.0/src/mp3.c	2007-07-08 04:20:22.000000000 +0300
+++ sox-debug/src/mp3.c	2008-01-17 17:36:40.000000000 +0200
@@ -530,7 +530,7 @@
   return SOX_EOF;
 }
 
-static sox_size_t sox_mp3write(sox_format_t * ft UNUSED, const sox_sample_t *buf UNUSED, sox_size_t samp UNUSED)
+static sox_size_t sox_mp3write(sox_format_t * ft UNUSED, const sox_ssample_t *buf UNUSED, sox_size_t samp UNUSED)
 {
   sox_fail_errno(ft,SOX_EOF,"SoX was compiled without MP3 encoding support");
   return 0;
diff -urb sox-14.0.0/src/tempo.c sox-debug/src/tempo.c
--- sox-14.0.0/src/tempo.c	2007-07-22 21:03:23.000000000 +0300
+++ sox-debug/src/tempo.c	2008-01-17 17:17:28.000000000 +0200
@@ -338,7 +338,8 @@
                 sox_ssample_t * obuf, sox_size_t * isamp, sox_size_t * osamp)
 {
   priv_t * p = (priv_t *) effp->priv;
-  sox_size_t i, odone = *osamp /= effp->ininfo.channels;
+  sox_size_t i;
+  size_t odone = *osamp /= effp->ininfo.channels;
   float const * s = tempo_output(p->tempo, NULL, &odone);
 
   for (i = 0; i < odone * effp->ininfo.channels; ++i)

Attachment: signature.asc
Description: Digital signature

Reply via email to