Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
93fc96e1
Commit
93fc96e1
authored
May 24, 2018
by
Colin NG
Committed by
Steven Liu
May 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/dashdec: Fix for ticket 7149 (Segfault when decoding dash streams)
simplify the code to check common init section
parent
9aee574d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
36 deletions
+10
-36
dashdec.c
libavformat/dashdec.c
+10
-36
No files found.
libavformat/dashdec.c
View file @
93fc96e1
...
@@ -1875,43 +1875,22 @@ fail:
...
@@ -1875,43 +1875,22 @@ fail:
return
ret
;
return
ret
;
}
}
static
int
i
nit_section_compare_video
(
DASHContext
*
c
)
static
int
i
s_common_init_section_exist
(
struct
representation
**
pls
,
int
n_pls
)
{
{
struct
fragment
*
first_init_section
=
pls
[
0
]
->
init_section
;
char
*
url
=
NULL
;
char
*
url
=
NULL
;
int64_t
url_offset
=
-
1
;
int64_t
url_offset
=
-
1
;
int64_t
size
=
-
1
;
int64_t
size
=
-
1
;
int
i
=
0
;
int
i
=
0
;
if
(
c
->
videos
[
0
]
->
init_section
==
NULL
)
if
(
first_init_section
==
NULL
||
n_pls
==
0
)
return
0
;
return
0
;
url
=
c
->
videos
[
0
]
->
init_section
->
url
;
url
=
first_init_section
->
url
;
url_offset
=
c
->
videos
[
0
]
->
init_section
->
url_offset
;
url_offset
=
first_init_section
->
url_offset
;
size
=
c
->
videos
[
0
]
->
init_section
->
size
;
size
=
pls
[
0
]
->
init_section
->
size
;
for
(
i
=
0
;
i
<
c
->
n_videos
;
i
++
)
{
for
(
i
=
0
;
i
<
n_pls
;
i
++
)
{
if
(
av_strcasecmp
(
c
->
videos
[
i
]
->
init_section
->
url
,
url
)
||
c
->
videos
[
i
]
->
init_section
->
url_offset
!=
url_offset
||
c
->
videos
[
i
]
->
init_section
->
size
!=
size
)
{
if
(
av_strcasecmp
(
pls
[
i
]
->
init_section
->
url
,
url
)
||
pls
[
i
]
->
init_section
->
url_offset
!=
url_offset
||
pls
[
i
]
->
init_section
->
size
!=
size
)
{
return
0
;
}
}
return
1
;
}
static
int
init_section_compare_audio
(
DASHContext
*
c
)
{
char
*
url
=
NULL
;
int64_t
url_offset
=
-
1
;
int64_t
size
=
-
1
;
int
i
=
0
;
if
(
c
->
audios
[
0
]
->
init_section
==
NULL
)
return
0
;
url
=
c
->
audios
[
0
]
->
init_section
->
url
;
url_offset
=
c
->
audios
[
0
]
->
init_section
->
url_offset
;
size
=
c
->
audios
[
0
]
->
init_section
->
size
;
for
(
i
=
0
;
i
<
c
->
n_audios
;
i
++
)
{
if
(
av_strcasecmp
(
c
->
audios
[
i
]
->
init_section
->
url
,
url
)
||
c
->
audios
[
i
]
->
init_section
->
url_offset
!=
url_offset
||
c
->
audios
[
i
]
->
init_section
->
size
!=
size
)
{
return
0
;
return
0
;
}
}
}
}
...
@@ -1957,9 +1936,7 @@ static int dash_read_header(AVFormatContext *s)
...
@@ -1957,9 +1936,7 @@ static int dash_read_header(AVFormatContext *s)
s
->
duration
=
(
int64_t
)
c
->
media_presentation_duration
*
AV_TIME_BASE
;
s
->
duration
=
(
int64_t
)
c
->
media_presentation_duration
*
AV_TIME_BASE
;
}
}
if
(
c
->
n_videos
)
{
c
->
is_init_section_common_video
=
is_common_init_section_exist
(
c
->
videos
,
c
->
n_videos
);
c
->
is_init_section_common_video
=
init_section_compare_video
(
c
);
}
/* Open the demuxer for video and audio components if available */
/* Open the demuxer for video and audio components if available */
for
(
i
=
0
;
i
<
c
->
n_videos
;
i
++
)
{
for
(
i
=
0
;
i
<
c
->
n_videos
;
i
++
)
{
...
@@ -1975,10 +1952,7 @@ static int dash_read_header(AVFormatContext *s)
...
@@ -1975,10 +1952,7 @@ static int dash_read_header(AVFormatContext *s)
++
stream_index
;
++
stream_index
;
}
}
c
->
is_init_section_common_audio
=
is_common_init_section_exist
(
c
->
audios
,
c
->
n_audios
);
if
(
c
->
n_audios
)
{
c
->
is_init_section_common_audio
=
init_section_compare_audio
(
c
);
}
for
(
i
=
0
;
i
<
c
->
n_audios
;
i
++
)
{
for
(
i
=
0
;
i
<
c
->
n_audios
;
i
++
)
{
struct
representation
*
cur_audio
=
c
->
audios
[
i
];
struct
representation
*
cur_audio
=
c
->
audios
[
i
];
...
...
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