media/libvorbis/bug487519.patch
author Taras Glek <tglek@mozilla.com>
Sat, 08 Aug 2009 12:07:39 +0200
changeset 31243 ff9eba3f82245af4bbee39ba022725e8ed3998ce
parent 31034 c6692a8f3f2725faadef43edd3142e533b452e62
permissions -rw-r--r--
Bug 504864 - mmap io for JARs; r=benjamin

diff --git a/media/libvorbis/lib/vorbis_synthesis.c b/media/libvorbis/lib/vorbis_synthesis.c
index 8872f57..b7b2399 100644
--- a/media/libvorbis/lib/vorbis_synthesis.c
+++ b/media/libvorbis/lib/vorbis_synthesis.c
@@ -43,9 +43,14 @@ int vorbis_synthesis(vorbis_block *vb,ogg_packet *op){
 
   /* read our mode and pre/post windowsize */
   mode=oggpack_read(opb,b->modebits);
-  if(mode==-1)return(OV_EBADPACKET);
+  if(mode==-1) {
+    return(OV_EBADPACKET);
+  }
 
   vb->mode=mode;
+  if(!ci->mode_param[mode]) {
+    return(OV_EBADPACKET); 
+  }
   vb->W=ci->mode_param[mode]->blockflag;
   if(vb->W){