[Speex-dev] Re: speexenc always crashes on amd64
Jean-Marc Valin
Jean-Marc.Valin at USherbrooke.ca
Sun Jan 1 19:22:08 PST 2006
Salut Nicolas,
Thanks for the patch. I applied it in svn.
Jean-Marc
Le dimanche 01 janvier 2006 à 18:08 +0100, Nicolas George a écrit :
> 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,
>
> _______________________________________________
> Speex-dev mailing list
> Speex-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev
More information about the Speex-dev
mailing list