[Vorbis-dev] Re: vorbis-tools 1.2.0 Release Candidate

Christian Weisgerber naddy at mips.inka.de
Sun Feb 10 10:52:19 PST 2008


Ivo Emanuel Gonçalves <justivo at gmail.com> wrote:

> Third and hopefully final Release Candidate is out[1].

There is a 64/32-bit screw-up in the ogg123 options parsing on LP64
platforms.

cfgfile_options.c expects opt_type_bool and opt_type_int settings
to be stored in long int variables.  However, ogg123.c:file_opts[]
points to options.shuffle and options.repeat, which are defined as
int in ogg123.h.  This means 64-bit values are written to 32-bit
variables, which--depending on the specifics of the platform regarding
endianness and strict alignment--can lead to garbage settings or a
fatal address error.  (E.g., on sparc64, ogg123 immediately dumps
core.)

The easiest fix is to bump the options.shuffle and .repeat variables up
to type long int.

--- ogg123/ogg123.h.orig	Sun Feb 10 19:32:19 2008
+++ ogg123/ogg123.h	Sun Feb 10 19:32:36 2008
@@ -25,8 +25,8 @@
 typedef struct ogg123_options_t {
   long int verbosity;         /* Verbose output if > 1, quiet if 0 */
 
-  int shuffle;                /* Should we shuffle playing? */
-  int repeat;                 /* Repeat playlist indefinitely? */
+  long int shuffle;           /* Should we shuffle playing? */
+  long int repeat;            /* Repeat playlist indefinitely? */
   ogg_int64_t delay;          /* delay (in millisecs) for skip to next song */
   int nth;                    /* Play every nth chunk */
   int ntimes;                 /* Play every chunk n times */
-- 
Christian "naddy" Weisgerber                          naddy at mips.inka.de


More information about the Vorbis-dev mailing list