Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
d65a02c1
Commit
d65a02c1
authored
Sep 23, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: ogg: fix headers validation
refs #12270
parent
35133fe7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
+16
-13
modules/demux/ogg.c
modules/demux/ogg.c
+15
-12
modules/demux/ogg.h
modules/demux/ogg.h
+1
-1
No files found.
modules/demux/ogg.c
View file @
d65a02c1
...
@@ -107,8 +107,11 @@ typedef struct
...
@@ -107,8 +107,11 @@ typedef struct
}
stream_header_t
;
}
stream_header_t
;
#define VORBIS_HEADER_IDENTIFICATION 1
#define VORBIS_HEADER_IDENTIFICATION 1
#define VORBIS_HEADER_COMMENT 2
#define VORBIS_HEADER_COMMENT 2
#define VORBIS_HEADER_SETUP 3
#define VORBIS_HEADER_SETUP 3
#define VORBIS_HEADER_TO_FLAG(i) (1 << (i - 1))
#define VORBIS_HEADERS_VALID(p_stream) \
((p_stream->special.vorbis.i_headers_flags & 0b111) == 0b111)
/*****************************************************************************
/*****************************************************************************
* Local prototypes
* Local prototypes
...
@@ -516,7 +519,7 @@ static int Demux( demux_t * p_demux )
...
@@ -516,7 +519,7 @@ static int Demux( demux_t * p_demux )
#ifdef HAVE_LIBVORBIS
#ifdef HAVE_LIBVORBIS
case
VLC_CODEC_VORBIS
:
case
VLC_CODEC_VORBIS
:
{
{
if
(
p_stream
->
special
.
vorbis
.
b_invalid
)
if
(
!
VORBIS_HEADERS_VALID
(
p_stream
)
)
{
{
msg_Err
(
p_demux
,
"missing vorbis headers, can't compute block size"
);
msg_Err
(
p_demux
,
"missing vorbis headers, can't compute block size"
);
break
;
break
;
...
@@ -997,7 +1000,7 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
...
@@ -997,7 +1000,7 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
#ifdef HAVE_LIBVORBIS
#ifdef HAVE_LIBVORBIS
else
if
(
p_stream
->
fmt
.
i_codec
==
VLC_CODEC_VORBIS
&&
else
if
(
p_stream
->
fmt
.
i_codec
==
VLC_CODEC_VORBIS
&&
p_stream
->
special
.
vorbis
.
p_info
&&
p_stream
->
special
.
vorbis
.
p_info
&&
!
p_stream
->
special
.
vorbis
.
b_invalid
&&
VORBIS_HEADERS_VALID
(
p_stream
)
&&
p_stream
->
i_previous_granulepos
>
0
)
p_stream
->
i_previous_granulepos
>
0
)
{
{
long
i_blocksize
=
vorbis_packet_blocksize
(
long
i_blocksize
=
vorbis_packet_blocksize
(
...
@@ -2126,7 +2129,7 @@ static void Ogg_CleanSpecificData( logical_stream_t *p_stream )
...
@@ -2126,7 +2129,7 @@ static void Ogg_CleanSpecificData( logical_stream_t *p_stream )
{
{
FREENULL
(
p_stream
->
special
.
vorbis
.
p_info
);
FREENULL
(
p_stream
->
special
.
vorbis
.
p_info
);
FREENULL
(
p_stream
->
special
.
vorbis
.
p_comment
);
FREENULL
(
p_stream
->
special
.
vorbis
.
p_comment
);
p_stream
->
special
.
vorbis
.
b_invalid
=
false
;
p_stream
->
special
.
vorbis
.
i_headers_flags
=
0
;
}
}
#else
#else
VLC_UNUSED
(
p_stream
);
VLC_UNUSED
(
p_stream
);
...
@@ -2578,7 +2581,6 @@ static void Ogg_DecodeVorbisHeader( logical_stream_t *p_stream,
...
@@ -2578,7 +2581,6 @@ static void Ogg_DecodeVorbisHeader( logical_stream_t *p_stream,
{
{
FREENULL
(
p_stream
->
special
.
vorbis
.
p_info
);
FREENULL
(
p_stream
->
special
.
vorbis
.
p_info
);
FREENULL
(
p_stream
->
special
.
vorbis
.
p_comment
);
FREENULL
(
p_stream
->
special
.
vorbis
.
p_comment
);
p_stream
->
special
.
vorbis
.
b_invalid
=
true
;
break
;
break
;
}
}
vorbis_info_init
(
p_stream
->
special
.
vorbis
.
p_info
);
vorbis_info_init
(
p_stream
->
special
.
vorbis
.
p_info
);
...
@@ -2587,12 +2589,13 @@ static void Ogg_DecodeVorbisHeader( logical_stream_t *p_stream,
...
@@ -2587,12 +2589,13 @@ static void Ogg_DecodeVorbisHeader( logical_stream_t *p_stream,
case
VORBIS_HEADER_COMMENT
:
case
VORBIS_HEADER_COMMENT
:
case
VORBIS_HEADER_SETUP
:
case
VORBIS_HEADER_SETUP
:
if
(
p_stream
->
special
.
vorbis
.
p_info
&&
!
p_stream
->
special
.
vorbis
.
b_invalid
)
if
(
!
p_stream
->
special
.
vorbis
.
p_info
||
{
vorbis_synthesis_headerin
(
p_stream
->
special
.
vorbis
.
b_invalid
=
(
0
!=
vorbis_synthesis_headerin
(
p_stream
->
special
.
vorbis
.
p_info
,
p_stream
->
special
.
vorbis
.
p_info
,
p_stream
->
special
.
vorbis
.
p_comment
,
p_oggpacket
)
)
p_stream
->
special
.
vorbis
.
p_comment
,
p_oggpacket
)
);
break
;
}
p_stream
->
special
.
vorbis
.
i_headers_flags
|=
VORBIS_HEADER_TO_FLAG
(
i_number
);
// ft
// ft
default:
default:
...
...
modules/demux/ogg.h
View file @
d65a02c1
...
@@ -127,7 +127,7 @@ typedef struct logical_stream_s
...
@@ -127,7 +127,7 @@ typedef struct logical_stream_s
{
{
vorbis_info
*
p_info
;
vorbis_info
*
p_info
;
vorbis_comment
*
p_comment
;
vorbis_comment
*
p_comment
;
bool
b_invalid
;
int
i_headers_flags
;
int
i_prev_blocksize
;
int
i_prev_blocksize
;
}
vorbis
;
}
vorbis
;
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment