[xiph-commits] r16330 - trunk/vorbis/lib
xiphmont at svn.xiph.org
xiphmont at svn.xiph.org
Thu Jul 23 18:58:50 PDT 2009
Author: xiphmont
Date: 2009-07-23 18:58:50 -0700 (Thu, 23 Jul 2009)
New Revision: 16330
Modified:
trunk/vorbis/lib/block.c
Log:
More extensive / difficult to abuse version of #1573 fix. Makes it abunduntly clear that the DSP state is uninitialized.
Modified: trunk/vorbis/lib/block.c
===================================================================
--- trunk/vorbis/lib/block.c 2009-07-24 01:53:20 UTC (rev 16329)
+++ trunk/vorbis/lib/block.c 2009-07-24 01:58:50 UTC (rev 16330)
@@ -235,13 +235,13 @@
if(!ci->fullbooks)
ci->fullbooks=_ogg_calloc(ci->books,sizeof(*ci->fullbooks));
for(i=0;i<ci->books;i++){
- if(ci->book_param[i]!=NULL){
- if(vorbis_book_init_decode(ci->fullbooks+i,ci->book_param[i]))
- return -1;
+ if(ci->book_param[i]==NULL)
+ goto abort_books;
+ if(vorbis_book_init_decode(ci->fullbooks+i,ci->book_param[i]))
+ goto abort_books;
/* decode codebooks are now standalone after init */
- vorbis_staticbook_destroy(ci->book_param[i]);
- ci->book_param[i]=NULL;
- }
+ vorbis_staticbook_destroy(ci->book_param[i]);
+ ci->book_param[i]=NULL;
}
}
@@ -279,6 +279,15 @@
look(v,ci->residue_param[i]);
return 0;
+ abort_books:
+ for(i=0;i<ci->books;i++){
+ if(ci->book_param[i]!=NULL){
+ vorbis_staticbook_destroy(ci->book_param[i]);
+ ci->book_param[i]=NULL;
+ }
+ }
+ vorbis_dsp_clear(v);
+ return -1;
}
/* arbitrary settings and spec-mandated numbers get filled in here */
More information about the commits
mailing list