[theora-dev] Bug#383793: libtheora0: not 64-bit clean

Peter De Wachter pdewacht at gmail.com
Sat Aug 19 08:06:23 PDT 2006


Package: libtheora0
Version: 0.0.0.alpha7-1
Severity: important
Tags: patch

The theora_unpack_comment casts a pointer-to-int to a pointer-to-long,
which breaks badly if ints and longs are different sizes. The attached
patch fixes this.


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17
Locale: LANG=nl_BE.UTF-8, LC_CTYPE=nl_BE.UTF-8 (charmap=UTF-8)

Versions of packages libtheora0 depends on:
ii  libc6                        2.3.6.ds1-2 GNU C Library: Shared libraries
ii  libogg0                      1.1.3-2     Ogg Bitstream Library

libtheora0 recommends no packages.

-- no debconf information
-------------- next part --------------
--- libtheora-0.0.0.alpha7/lib/toplevel.c	2006-06-13 00:57:36.000000000 +0200
+++ libtheora-pdw/lib/toplevel.c	2006-08-19 16:55:30.000000000 +0200
@@ -172,7 +172,7 @@
 
 static int _theora_unpack_comment(theora_comment *tc, oggpack_buffer *opb){
   int i;
-  long len;
+  long len,tmp;
 
    _tp_readlsbint(opb,&len);
   if(len<0)return(OC_BADHEADER);
@@ -180,7 +180,8 @@
   _tp_readbuffer(opb,tc->vendor, len);
   tc->vendor[len]='\0';
 
-  _tp_readlsbint(opb,(long *) &tc->comments);
+  _tp_readlsbint(opb,&tmp);
+  tc->comments=tmp;
   if(tc->comments<0)goto parse_err;
   tc->user_comments=_ogg_calloc(tc->comments,sizeof(*tc->user_comments));
   tc->comment_lengths=_ogg_calloc(tc->comments,sizeof(*tc->comment_lengths));


More information about the theora-dev mailing list