summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2010-12-08 15:42:40 +0000
committerNils Wallménius <nils@rockbox.org>2010-12-08 15:42:40 +0000
commit715749a7f4597e14a81941c16852d2fcec4e1f85 (patch)
treec75e9203504b35db2e07171e932209ba84dcce5f /apps
parentf51d6e6507681a286cbddab8cb04f6db083f93e9 (diff)
downloadrockbox-715749a7f4597e14a81941c16852d2fcec4e1f85.tar.gz
rockbox-715749a7f4597e14a81941c16852d2fcec4e1f85.tar.bz2
rockbox-715749a7f4597e14a81941c16852d2fcec4e1f85.zip
libtremor: merge upstream revision 17526 and 17531, adding some more error checking.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28766 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/libtremor/block.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/apps/codecs/libtremor/block.c b/apps/codecs/libtremor/block.c
index a86668a521..0eaf7bc820 100644
--- a/apps/codecs/libtremor/block.c
+++ b/apps/codecs/libtremor/block.c
@@ -199,7 +199,10 @@ static int _vds_init(vorbis_dsp_state *v,vorbis_info *vi){
if(!ci->fullbooks){
ci->fullbooks=(codebook *)_ogg_calloc(ci->books,sizeof(*ci->fullbooks));
for(i=0;i<ci->books;i++){
- vorbis_book_init_decode(ci->fullbooks+i,ci->book_param[i]);
+ 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;
@@ -247,6 +250,15 @@ static int _vds_init(vorbis_dsp_state *v,vorbis_info *vi){
}
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;
}
int vorbis_synthesis_restart(vorbis_dsp_state *v){