diff --git a/audio/libvorbis/Makefile b/audio/libvorbis/Makefile index 125c02a54ed..04a6dfb9823 100644 --- a/audio/libvorbis/Makefile +++ b/audio/libvorbis/Makefile @@ -1,8 +1,9 @@ -# $OpenBSD: Makefile,v 1.25 2007/07/30 15:29:35 naddy Exp $ +# $OpenBSD: Makefile,v 1.26 2008/05/17 19:58:25 naddy Exp $ COMMENT= audio compression codec library DISTNAME= libvorbis-1.2.0 +PKGNAME= ${DISTNAME}p0 CATEGORIES= audio HOMEPAGE= http://www.xiph.org/vorbis/ SHARED_LIBS += vorbis 6.0 # .4.0 diff --git a/audio/libvorbis/patches/patch-lib_codebook_c b/audio/libvorbis/patches/patch-lib_codebook_c new file mode 100644 index 00000000000..5d581d0f6c6 --- /dev/null +++ b/audio/libvorbis/patches/patch-lib_codebook_c @@ -0,0 +1,21 @@ +$OpenBSD: patch-lib_codebook_c,v 1.1 2008/05/17 19:58:25 naddy Exp $ +--- lib/codebook.c.orig Sat May 17 21:25:08 2008 ++++ lib/codebook.c Sat May 17 21:26:54 2008 +@@ -159,6 +159,8 @@ int vorbis_staticbook_unpack(oggpack_buffer *opb,stati + s->entries=oggpack_read(opb,24); + if(s->entries==-1)goto _eofout; + ++ if(_ilog(s->dim)+_ilog(s->entries)>24)goto _eofout; ++ + /* codeword ordering.... length ordered or unordered? */ + switch((int)oggpack_read(opb,1)){ + case 0: +@@ -225,7 +227,7 @@ int vorbis_staticbook_unpack(oggpack_buffer *opb,stati + int quantvals=0; + switch(s->maptype){ + case 1: +- quantvals=_book_maptype1_quantvals(s); ++ quantvals=(s->dim==0?0:_book_maptype1_quantvals(s)); + break; + case 2: + quantvals=s->entries*s->dim; diff --git a/audio/libvorbis/patches/patch-lib_res0_c b/audio/libvorbis/patches/patch-lib_res0_c new file mode 100644 index 00000000000..1d489d0200c --- /dev/null +++ b/audio/libvorbis/patches/patch-lib_res0_c @@ -0,0 +1,33 @@ +$OpenBSD: patch-lib_res0_c,v 1.2 2008/05/17 19:58:25 naddy Exp $ +--- lib/res0.c.orig Sat May 17 21:22:14 2008 ++++ lib/res0.c Sat May 17 21:24:04 2008 +@@ -223,6 +223,20 @@ vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpa + for(j=0;jbooklist[j]>=ci->books)goto errout; + ++ /* verify the phrasebook is not specifying an impossible or ++ inconsistent partitioning scheme. */ ++ { ++ int entries = ci->book_param[info->groupbook]->entries; ++ int dim = ci->book_param[info->groupbook]->dim; ++ int partvals = 1; ++ while(dim>0){ ++ partvals *= info->partitions; ++ if(partvals > entries) goto errout; ++ dim--; ++ } ++ if(partvals != entries) goto errout; ++ } ++ + return(info); + errout: + res0_free_info(info); +@@ -263,7 +277,7 @@ vorbis_look_residue *res0_look(vorbis_dsp_state *vd, + } + } + +- look->partvals=rint(pow((float)look->parts,(float)dim)); ++ look->partvals=look->phrasebook->entries; + look->stages=maxstage; + look->decodemap=_ogg_malloc(look->partvals*sizeof(*look->decodemap)); + for(j=0;jpartvals;j++){