Bug 550184. Avoid using uninitialized data. r=doublec
authorTim Terriberry <tterribe@xiph.org>
Fri, 05 Mar 2010 13:10:42 +1300
changeset 38967 d63280421a8d92ce3b14f49520177e5724c342ee
parent 38966 ac9b76514eec082b78a49ff440459ad4532ad912
child 38968 af5cdd5966d93b6bbe891b7d151a2fd799b51932
push idunknown
push userunknown
push dateunknown
reviewersdoublec
bugs550184
milestone1.9.3a3pre
Bug 550184. Avoid using uninitialized data. r=doublec
media/libvorbis/README_MOZILLA
media/libvorbis/bug550184.patch
media/libvorbis/lib/vorbis_info.c
media/libvorbis/update.sh
--- a/media/libvorbis/README_MOZILLA
+++ b/media/libvorbis/README_MOZILLA
@@ -6,8 +6,9 @@ Makefile.in files for the Mozilla build 
 The svn revision number used was r16597.
 
 Some files are renamed during the copy to prevent clashes with object
 file names with other Mozilla libraries.
 
 alloca.diff - Bug 469639 - Failed to build firefox trunk on OpenSolaris
 bug487519.patch: fix for bug 487519.
 bug498855.patch: fix for bug 498855
+bug550184.patch: fix for bug 550184 (Xiph trac 1656)
new file mode 100644
--- /dev/null
+++ b/media/libvorbis/bug550184.patch
@@ -0,0 +1,18 @@
+diff --git a/media/libvorbis/lib/vorbis_info.c b/media/libvorbis/lib/vorbis_info.c
+index 30088d8..8583224 100644
+--- a/media/libvorbis/lib/vorbis_info.c
++++ b/media/libvorbis/lib/vorbis_info.c
+@@ -628,12 +628,12 @@ int vorbis_analysis_headerout(vorbis_dsp_state *v,
+   oggpack_writeclear(&opb);
+   return(0);
+  err_out:
+-  oggpack_writeclear(&opb);
+   memset(op,0,sizeof(*op));
+   memset(op_comm,0,sizeof(*op_comm));
+   memset(op_code,0,sizeof(*op_code));
+ 
+   if(b){
++    oggpack_writeclear(&opb);
+     if(b->header)_ogg_free(b->header);
+     if(b->header1)_ogg_free(b->header1);
+     if(b->header2)_ogg_free(b->header2);
--- a/media/libvorbis/lib/vorbis_info.c
+++ b/media/libvorbis/lib/vorbis_info.c
@@ -623,22 +623,22 @@ int vorbis_analysis_headerout(vorbis_dsp
   op_code->b_o_s=0;
   op_code->e_o_s=0;
   op_code->granulepos=0;
   op_code->packetno=2;
 
   oggpack_writeclear(&opb);
   return(0);
  err_out:
-  oggpack_writeclear(&opb);
   memset(op,0,sizeof(*op));
   memset(op_comm,0,sizeof(*op_comm));
   memset(op_code,0,sizeof(*op_code));
 
   if(b){
+    oggpack_writeclear(&opb);
     if(b->header)_ogg_free(b->header);
     if(b->header1)_ogg_free(b->header1);
     if(b->header2)_ogg_free(b->header2);
     b->header=NULL;
     b->header1=NULL;
     b->header2=NULL;
   }
   return(ret);
--- a/media/libvorbis/update.sh
+++ b/media/libvorbis/update.sh
@@ -44,8 +44,9 @@ cp $1/lib/block.c ./lib/vorbis_block.c
 cp $1/include/vorbis/codec.h ./include/vorbis/codec.h
 cp $1/todo.txt ./todo.txt
 cp $1/COPYING ./COPYING
 cp $1/README ./README
 cp $1/AUTHORS ./AUTHORS
 patch -p3 < ./alloca.diff
 patch -p3 <bug487519.patch
 patch -p3 <bug498855.patch
+patch -p3 <bug550184.patch