Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Sep 2010 16:33:02 GMT
From:      Yamagi Burmeister <yamagi@yamagi.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/150653: OGG/Vorbis playback with mplayer is broken
Message-ID:  <201009171633.o8HGX2AJ024030@www.freebsd.org>
Resent-Message-ID: <201009171640.o8HGe1T8083922@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         150653
>Category:       ports
>Synopsis:       OGG/Vorbis playback with mplayer is broken
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 17 16:40:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Yamagi Burmeister
>Release:        FreeBSD/amd64 8.1-RELEASE
>Organization:
>Environment:
FreeBSD saya.home.yamagi.org 8.1-RELEASE FreeBSD 8.1-RELEASE #0 r210188M: Sat Jul 17 09:55:25 CEST 2010     root@saya.home.yamagi.org:/usr/obj/usr/src/sys/SAYA  amd64

>Description:
Since mplayer 1.0.r20100717 playback of some OGG/Vorbis files is broken. Trying to play various OGG/Vorbis files created with the latest version of libvorbise.c results in error messages like this:

[vorbis @ 0x806e39c10] Index value 45 out of range (0 - 43) for bits at vorbis_dec.c:520
[vorbis @ 0x806e39c10]  Vorbis setup header packet corrupt (floors). 
[vorbis @ 0x806e39c10] Setup header corrupt
>How-To-Repeat:
Play an OGG/Vorbis file created with the current version of libvorbisenc.so, part of audio/libvorbis-1.3.1,3. The file can be created with mplayer itself.
>Fix:
This is a problem with datatypes in variables in the upstream source. The problem is fixed upstream but since a complete update of the port to a newer svn snapshot will most likely break other things I've backported fix to our current version. Just put the attached patch into multimedia/mplayer/files, rebuild the port and OGG/Vorbis will be work again. The patch applies against libavcodec/vorbis_dec.c

Patch attached with submission follows:

--- libavcodec/vorbis_dec.c.orig	2010-07-02 19:05:36.000000000 +0200
+++ libavcodec/vorbis_dec.c	2010-09-16 17:32:17.754521304 +0200
@@ -81,7 +81,7 @@
         } t0;
         struct vorbis_floor1_s {
             uint_fast8_t partitions;
-            uint_fast8_t partition_class[32];
+            uint8_t      partition_class[32];
             uint_fast8_t class_dimensions[16];
             uint_fast8_t class_subclasses[16];
             uint_fast8_t class_masterbook[16];
@@ -97,13 +97,13 @@
     uint_fast16_t type;
     uint_fast32_t begin;
     uint_fast32_t end;
-    uint_fast32_t partition_size;
+    unsigned      partition_size;
     uint_fast8_t  classifications;
     uint_fast8_t  classbook;
     int_fast16_t  books[64][8];
     uint_fast8_t  maxpass;
     uint_fast16_t ptns_to_read;
-    uint_fast8_t *classifs;
+    uint8_t *classifs;
 } vorbis_residue;
 
 typedef struct {
@@ -467,7 +467,7 @@
 static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
 {
     GetBitContext *gb = &vc->gb;
-    uint_fast16_t i,j,k;
+    int i,j,k;
 
     vc->floor_count = get_bits(gb, 6) + 1;
 
@@ -655,7 +655,7 @@
         if (res_setup->begin>res_setup->end ||
             res_setup->end > vc->avccontext->channels * vc->blocksize[1] / (res_setup->type == 2 ? 1 : 2) ||
             (res_setup->end-res_setup->begin) / res_setup->partition_size > V_MAX_PARTITIONS) {
-            av_log(vc->avccontext, AV_LOG_ERROR, "partition out of bounds: type, begin, end, size, blocksize: %"PRIdFAST16", %"PRIdFAST32", %"PRIdFAST32", %"PRIdFAST32", %"PRIdFAST32"\n", res_setup->type, res_setup->begin, res_setup->end, res_setup->partition_size, vc->blocksize[1] / 2);
+            av_log(vc->avccontext, AV_LOG_ERROR, "partition out of bounds: type, begin, end, size, blocksize: %"PRIdFAST16", %"PRIdFAST32", %"PRIdFAST32", %u, %"PRIdFAST32"\n", res_setup->type, res_setup->begin, res_setup->end, res_setup->partition_size, vc->blocksize[1] / 2);
             return -1;
         }
 
@@ -667,6 +667,8 @@
         res_setup->classifs = av_malloc(res_setup->ptns_to_read *
                                         vc->audio_channels *
                                         sizeof(*res_setup->classifs));
+        if (!res_setup->classifs)
+            return AVERROR(ENOMEM);
 
         AV_DEBUG("    begin %d end %d part.size %d classif.s %d classbook %d \n", res_setup->begin, res_setup->end, res_setup->partition_size,
           res_setup->classifications, res_setup->classbook);
@@ -1267,7 +1269,7 @@
     GetBitContext *gb = &vc->gb;
     uint_fast8_t c_p_c = vc->codebooks[vr->classbook].dimensions;
     uint_fast16_t ptns_to_read = vr->ptns_to_read;
-    uint_fast8_t *classifs = vr->classifs;
+    uint8_t *classifs = vr->classifs;
     uint_fast8_t pass;
     uint_fast8_t ch_used;
     uint_fast8_t i,j,l;


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009171633.o8HGX2AJ024030>