summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Terriberry <tterribe@xiph.org>2018-03-19 13:08:21 -0700
committerThomas Daede <daede003@umn.edu>2018-03-19 13:08:57 -0700
commit7c30a66346199f3f09017a09567c6c8a3a0eedc8 (patch)
treecdccecb704c46caa235e7aa8187cf2b741b52c59
parent562307a4a7082e24553f3d2c55dab397a17c4b4f (diff)
downloadtremor-master.tar.gz
Port r19426 from libvorbis.HEADmaster
Reject multiple headers of the same type.
-rw-r--r--info.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/info.c b/info.c
index 3f3308e..24e24ac 100644
--- a/info.c
+++ b/info.c
@@ -227,7 +227,6 @@ static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){
static int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){
codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
int i;
- if(!ci)return(OV_EFAULT);
/* codebooks */
ci->books=oggpack_read(opb,8)+1;
@@ -367,6 +366,10 @@ int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op)
/* um... we didn't get the initial header */
return(OV_EBADHEADER);
}
+ if(vc->vendor!=NULL){
+ /* previously initialized comment header */
+ return(OV_EBADHEADER);
+ }
return(_vorbis_unpack_comment(vc,&opb));
@@ -375,6 +378,14 @@ int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op)
/* um... we didn;t get the initial header or comments yet */
return(OV_EBADHEADER);
}
+ if(vi->codec_setup==NULL){
+ /* improperly initialized vorbis_info */
+ return(OV_EFAULT);
+ }
+ if(((codec_setup_info *)vi->codec_setup)->books>0){
+ /* previously initialized setup header */
+ return(OV_EBADHEADER);
+ }
return(_vorbis_unpack_books(vi,&opb));