From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Sep 17 16:40:02 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 605DD1065694 for ; Fri, 17 Sep 2010 16:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 22A188FC1F for ; Fri, 17 Sep 2010 16:40:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o8HGe1JZ083923 for ; Fri, 17 Sep 2010 16:40:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o8HGe1T8083922; Fri, 17 Sep 2010 16:40:01 GMT (envelope-from gnats) Resent-Date: Fri, 17 Sep 2010 16:40:01 GMT Resent-Message-Id: <201009171640.o8HGe1T8083922@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Yamagi Burmeister Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A501106564A for ; Fri, 17 Sep 2010 16:33:03 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 580F98FC1C for ; Fri, 17 Sep 2010 16:33:03 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o8HGX3Ru024031 for ; Fri, 17 Sep 2010 16:33:03 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o8HGX2AJ024030; Fri, 17 Sep 2010 16:33:02 GMT (envelope-from nobody) Message-Id: <201009171633.o8HGX2AJ024030@www.freebsd.org> Date: Fri, 17 Sep 2010 16:33:02 GMT From: Yamagi Burmeister To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/150653: OGG/Vorbis playback with mplayer is broken X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 16:40:02 -0000 >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: