[vorbis-dev] Re: libogg 1.1 test failure on alpha

Dominik Kuhlen dh0dom at amsat.org
Wed Dec 10 12:44:01 PST 2003



Hello !
On Sunday 07 December 2003 02:11, Christian Weisgerber wrote:
> Bill Nottingham <notting at redhat.com> wrote:
> > The oggpackB_{look,read} functions appear to not be right on 64-bit.
>
> I finally sat down and looked at this.
>
> Both functions fail to mask off the upper bits.  There's an implicit
> assumption that all arithmetic is & 0xffffffff, which holds on
> 32-bit machines, but fails on 64-bit ones.
>
> (BTW, I don't understand the change from 1.16 to 1.17 in bitwise.c.
> These expressions are exactly equivalent, aren't they?)
>
>
> --- src/bitwise.c.orig	2003-12-07 01:48:17.000000000 +0100
> +++ src/bitwise.c	2003-12-07 01:52:58.000000000 +0100
> @@ -251,7 +251,8 @@ long oggpack_look(oggpack_buffer *b,int
>  /* Read in bits without advancing the bitptr; bits <= 32 */
>  long oggpackB_look(oggpack_buffer *b,int bits){
>    unsigned long ret;
> -  int m=32-bits;
> +  unsigned long m=mask[bits];
> +  int s=32-bits;

Why are 'int' and 'long' used and not ogg_int32_t and ogg_int64_t as
defined in os_types.h ?
This would prevent these errors to occur, wouldn't it?

Dominik

<p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list