Package: libogg0
Version: 1.1.0-1
Severity: important
Tags: patch
Hi,
libogg0 is not 64bit clean as it assumes sizeof(int) == sizeof(long); it is
especially problematic when dealing with bitwise operations, as does half of
libogg...
As it happens, it is not possible to read an OGG file containing a Theora
stream without this patch, as libtheora will (correctly) fail to recognize the
Theora stream.
The attached patch fixes the problem, by using an unsigned int instead of an
unsigned long. The two modified functions manipulate bits 0-31 as indicated in
the comments above the functions, so it's safe.
A first patch was sent over 2 years ago to the theora-dev list...
Please apply,
JB.
-- System Information:
Debian Release: 3.1
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.9
Locale: LANG=C, LC_CTYPE=fr_FR@euro (charmap=ISO-8859-15)
Versions of packages libogg0 depends on:
ii libc6 2.3.2.ds1-18 GNU C Library: Shared libraries an
/* Read in bits without advancing the bitptr; bits <= 32 */
long oggpackB_look(oggpack_buffer *b,int bits){
- unsigned long ret;
+ unsigned int ret;
int m=32-bits;
bits+=b->endbit;
@@ -346,14 +346,14 @@
/* bits <= 32 */
long oggpackB_read(oggpack_buffer *b,int bits){
- unsigned long ret;
+ unsigned int ret;
long m=32-bits;
bits+=b->endbit;
if(b->endbyte+4>=b->storage){
/* not the main path */
- ret=-1UL;
+ ret=-1U;
if(b->endbyte*8+bits>b->storage*8)goto overflow;
}
Message-Id: <email address hidden>
Date: Thu, 25 Nov 2004 23:10:06 +0100
From: Julien BLACHE <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: libogg0: not 64bit clean
--===== ======= ===732565277547 9110625= = Transfer- Encoding: 7bit Disposition: inline
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-
Content-
Package: libogg0
Version: 1.1.0-1
Severity: important
Tags: patch
Hi,
libogg0 is not 64bit clean as it assumes sizeof(int) == sizeof(long); it is
especially problematic when dealing with bitwise operations, as does half of
libogg...
As it happens, it is not possible to read an OGG file containing a Theora
stream without this patch, as libtheora will (correctly) fail to recognize the
Theora stream.
The attached patch fixes the problem, by using an unsigned int instead of an
unsigned long. The two modified functions manipulate bits 0-31 as indicated in
the comments above the functions, so it's safe.
A first patch was sent over 2 years ago to the theora-dev list...
Please apply,
JB.
-- System Information: ISO-8859- 15)
Debian Release: 3.1
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.9
Locale: LANG=C, LC_CTYPE=fr_FR@euro (charmap=
Versions of packages libogg0 depends on:
ii libc6 2.3.2.ds1-18 GNU C Library: Shared libraries an
-- no debconf information
--===== ======= ===732565277547 9110625= = Transfer- Encoding: 7bit Disposition: attachment; filename= "libogg_ bitwise. c_64bit_ fix.patch"
Content-Type: text/x-c; charset="us-ascii"
MIME-Version: 1.0
Content-
Content-
--- libogg- 1.1.0.orig/ src/bitwise. c 1.1.0/src/ bitwise. c
+++ libogg-
@@ -250,7 +250,7 @@
/* Read in bits without advancing the bitptr; bits <= 32 */ look(oggpack_ buffer *b,int bits){
long oggpackB_
- unsigned long ret;
+ unsigned int ret;
int m=32-bits;
bits+=b->endbit;
@@ -346,14 +346,14 @@
/* bits <= 32 */ read(oggpack_ buffer *b,int bits){
long oggpackB_
- unsigned long ret;
+ unsigned int ret;
long m=32-bits;
bits+=b->endbit;
if(b- >endbyte+ 4>=b->storage) { b->endbyte* 8+bits> b->storage* 8)goto overflow;
/* not the main path */
- ret=-1UL;
+ ret=-1U;
if(
}
--===== ======= ===732565277547 9110625= =--