/
0000-tremor.git-7c30a663.patch
48 lines (40 loc) · 1.57 KB
/
0000-tremor.git-7c30a663.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From: Tim Terriberry <tterribe@xiph.org>
Date: Mon, 19 Mar 2018 20:08:21 +0000 (-0700)
Subject: Port r19426 from libvorbis.
X-Git-Url: http://git.xiph.org/?p=tremor.git;a=commitdiff_plain;h=7c30a66346199f3f09017a09567c6c8a3a0eedc8
Port r19426 from libvorbis.
Reject multiple headers of the same type.
---
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));