[Speex-dev] Re: speexenc always crashes on amd64

Nicolas George nicolas.george at ens.fr
Sun Jan 1 09:08:31 PST 2006


Hi.

Le duodi 2 frimaire, an CCXIV, Wesley J. Landaker a écrit :
> speexenc always crashes on amd64; here is an example, and lots of info:

I tracked this bug a bit further than you. Here is the origin of the crash:

      op.packet = (unsigned char *)speex_header_to_packet(&header, (int*)&(op.bytes));

(from speexenc.c)

op.bytes is a long, not an int, it is wrong to pass it as an int, and it is
even wronger to use a cast to hide the warning.

Here is a fix:

--- speexenc.c.orig     2006-01-01 17:56:44.157165648 +0100
+++ speexenc.c  2006-01-01 17:57:39.994551085 +0100
@@ -629,7 +629,9 @@
    /*Write header*/
    {
 
-      op.packet = (unsigned char *)speex_header_to_packet(&header, (int*)&(op.bytes));
+      int packet_size;
+      op.packet = (unsigned char *)speex_header_to_packet(&header, &packet_size);
+      op.bytes = size;
       op.b_o_s = 1;
       op.e_o_s = 0;
       op.granulepos = 0;

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: Digital signature
Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20060101/3bce3390/attachment.pgp


More information about the Speex-dev mailing list