summaryrefslogtreecommitdiff
path: root/audio/libvorbis/patches/patch-aa
diff options
context:
space:
mode:
Diffstat (limited to 'audio/libvorbis/patches/patch-aa')
-rw-r--r--audio/libvorbis/patches/patch-aa34
1 files changed, 34 insertions, 0 deletions
diff --git a/audio/libvorbis/patches/patch-aa b/audio/libvorbis/patches/patch-aa
new file mode 100644
index 00000000000..68a94ca9833
--- /dev/null
+++ b/audio/libvorbis/patches/patch-aa
@@ -0,0 +1,34 @@
+$NetBSD: patch-aa,v 1.3 2008/05/14 16:36:18 drochner Exp $
+
+--- ./lib/res0.c.orig 2007-07-24 02:09:47.000000000 +0200
++++ ./lib/res0.c
+@@ -223,6 +223,20 @@ vorbis_info_residue *res0_unpack(vorbis_
+ for(j=0;j<acc;j++)
+ if(info->booklist[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_ds
+ }
+ }
+
+- 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;j<look->partvals;j++){