Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
9aee574d
Commit
9aee574d
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)
Add NULL pointer check for init_section
parent
8ef51a40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
dashdec.c
libavformat/dashdec.c
+23
-7
No files found.
libavformat/dashdec.c
View file @
9aee574d
...
...
@@ -1877,25 +1877,40 @@ fail:
static
int
init_section_compare_video
(
DASHContext
*
c
)
{
char
*
url
=
NULL
;
int64_t
url_offset
=
-
1
;
int64_t
size
=
-
1
;
int
i
=
0
;
char
*
url
=
c
->
videos
[
0
]
->
init_section
->
url
;
int64_t
url_offset
=
c
->
videos
[
0
]
->
init_section
->
url_offset
;
int64_t
size
=
c
->
videos
[
0
]
->
init_section
->
size
;
if
(
c
->
videos
[
0
]
->
init_section
==
NULL
)
return
0
;
url
=
c
->
videos
[
0
]
->
init_section
->
url
;
url_offset
=
c
->
videos
[
0
]
->
init_section
->
url_offset
;
size
=
c
->
videos
[
0
]
->
init_section
->
size
;
for
(
i
=
0
;
i
<
c
->
n_videos
;
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
)
{
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
;
char
*
url
=
c
->
audios
[
0
]
->
init_section
->
url
;
int64_t
url_offset
=
c
->
audios
[
0
]
->
init_section
->
url_offset
;
int64_t
size
=
c
->
audios
[
0
]
->
init_section
->
size
;
for
(
i
=
0
;
i
<
c
->
n_audios
;
i
++
)
{
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
;
}
...
...
@@ -1960,6 +1975,7 @@ static int dash_read_header(AVFormatContext *s)
++
stream_index
;
}
if
(
c
->
n_audios
)
{
c
->
is_init_section_common_audio
=
init_section_compare_audio
(
c
);
}
...
...
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