Bug 498855 - libvorbis update - r=xiphmont
authorChris Double <chris.double@double.co.nz>
Fri, 19 Jun 2009 15:33:29 +1200
changeset 29346 1271d9a47bfb3286d9293e23022b95c0a15b3c87
parent 29345 72ad47d78ef312c6d5aa8435775bfabb975150ed
child 29347 592ca03298273cca07dc9d0cc52dbdaffaee2f86
push idunknown
push userunknown
push dateunknown
reviewersxiphmont
bugs498855
milestone1.9.2a1pre
Bug 498855 - libvorbis update - r=xiphmont
media/libvorbis/README_MOZILLA
media/libvorbis/bug498855.patch
media/libvorbis/lib/vorbis_synthesis.c
media/libvorbis/update.sh
--- a/media/libvorbis/README_MOZILLA
+++ b/media/libvorbis/README_MOZILLA
@@ -7,9 +7,10 @@ Some files are renamed during the copy t
 file names with other Mozilla libraries.
 
 BUG 455372 - WinCE LibVorbis No FPU Support on WinMobile, removed FPU
 support for builds with WINCE defined.
 
 BUG 469639 - Failed to build firefox trunk on OpenSolaris
 bug481601.patch is appled to fix bug 481601.
 bug487519.patch: fix for bug 487519.
-bug498827.patch: fix for bug 498827
\ No newline at end of file
+bug498827.patch: fix for bug 498827
+bug498855.patch: fix for bug 498855
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/media/libvorbis/bug498855.patch
@@ -0,0 +1,36 @@
+diff --git a/media/libvorbis/lib/vorbis_synthesis.c b/media/libvorbis/lib/vorbis_synthesis.c
+index b7b2399..05774fd 100644
+--- a/media/libvorbis/lib/vorbis_synthesis.c
++++ b/media/libvorbis/lib/vorbis_synthesis.c
+@@ -19,22 +19,26 @@
+ #include <ogg/ogg.h>
+ #include "vorbis/codec.h"
+ #include "codec_internal.h"
+ #include "registry.h"
+ #include "misc.h"
+ #include "os.h"
+ 
+ int vorbis_synthesis(vorbis_block *vb,ogg_packet *op){
+-  vorbis_dsp_state     *vd=vb->vd;
+-  private_state        *b=vd->backend_state;
+-  vorbis_info          *vi=vd->vi;
+-  codec_setup_info     *ci=vi->codec_setup;
+-  oggpack_buffer       *opb=&vb->opb;
++  vorbis_dsp_state     *vd= vb ? vb->vd : 0;
++  private_state        *b= vd ? vd->backend_state : 0;
++  vorbis_info          *vi= vd ? vd->vi : 0;
++  codec_setup_info     *ci= vi ? vi->codec_setup : 0;
++  oggpack_buffer       *opb=vb ? &vb->opb : 0;
+   int                   type,mode,i;
++
++  if (!vd || !b || !vi || !ci || !opb) {
++    return OV_EBADPACKET;
++  }
+  
+   /* first things first.  Make sure decode is ready */
+   _vorbis_block_ripcord(vb);
+   oggpack_readinit(opb,op->packet,op->bytes);
+ 
+   /* Check the packet type */
+   if(oggpack_read(opb,1)!=0){
+     /* Oops.  This is not an audio data packet */
--- a/media/libvorbis/lib/vorbis_synthesis.c
+++ b/media/libvorbis/lib/vorbis_synthesis.c
@@ -19,22 +19,26 @@
 #include <ogg/ogg.h>
 #include "vorbis/codec.h"
 #include "codec_internal.h"
 #include "registry.h"
 #include "misc.h"
 #include "os.h"
 
 int vorbis_synthesis(vorbis_block *vb,ogg_packet *op){
-  vorbis_dsp_state     *vd=vb->vd;
-  private_state        *b=vd->backend_state;
-  vorbis_info          *vi=vd->vi;
-  codec_setup_info     *ci=vi->codec_setup;
-  oggpack_buffer       *opb=&vb->opb;
+  vorbis_dsp_state     *vd= vb ? vb->vd : 0;
+  private_state        *b= vd ? vd->backend_state : 0;
+  vorbis_info          *vi= vd ? vd->vi : 0;
+  codec_setup_info     *ci= vi ? vi->codec_setup : 0;
+  oggpack_buffer       *opb=vb ? &vb->opb : 0;
   int                   type,mode,i;
+
+  if (!vd || !b || !vi || !ci || !opb) {
+    return OV_EBADPACKET;
+  }
  
   /* first things first.  Make sure decode is ready */
   _vorbis_block_ripcord(vb);
   oggpack_readinit(opb,op->packet,op->bytes);
 
   /* Check the packet type */
   if(oggpack_read(opb,1)!=0){
     /* Oops.  This is not an audio data packet */
--- a/media/libvorbis/update.sh
+++ b/media/libvorbis/update.sh
@@ -45,8 +45,9 @@ cp $1/include/vorbis/codec.h ./include/v
 cp $1/todo.txt ./todo.txt
 cp $1/COPYING ./COPYING
 cp $1/README ./README
 cp $1/AUTHORS ./AUTHORS
 patch -p3 < ./alloca.diff
 patch -p3 <./bug481601.patch
 patch -p3 <bug487519.patch
 patch -p3 <bug498827.patch
+patch -p3 <bug498855.patch