diff options
-rw-r--r-- | apps/codecs/libtremor/info.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/apps/codecs/libtremor/info.c b/apps/codecs/libtremor/info.c index e96dd88b70..cb3860bbff 100644 --- a/apps/codecs/libtremor/info.c +++ b/apps/codecs/libtremor/info.c @@ -138,34 +138,11 @@ static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){ } static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){ - int i; int vendorlen=oggpack_read(opb,32); if(vendorlen<0)goto err_out; vc->vendor=(char *)_ogg_calloc(vendorlen+1,1); _v_readstring(opb,vc->vendor,vendorlen); - vc->comments=oggpack_read(opb,32); - if(vc->comments<0)goto err_out; - vc->user_comments=(char **)_ogg_calloc(vc->comments+1,sizeof(*vc->user_comments)); - vc->comment_lengths=(int *)_ogg_calloc(vc->comments+1, sizeof(*vc->comment_lengths)); - - for(i=0;i<vc->comments;i++){ - int len=oggpack_read(opb,32); - if(len<0)goto err_out; - vc->comment_lengths[i]=len; - if(len>10000){ /*truncate long comments rather then seg faulting*/ - vc->user_comments[i]=(char *)_ogg_calloc(10001,1); - _v_readstring(opb,vc->user_comments[i],10000); - /*just to be neat, consumed and discard the rest of the comment*/ - len-=10000; - while(len--) - oggpack_read(opb,8); - }else{ - vc->user_comments[i]=(char *)_ogg_calloc(len+1,1); - _v_readstring(opb,vc->user_comments[i],len); - } - } - if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */ - + vc->comments=0; return(0); err_out: vorbis_comment_clear(vc); |