Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
5ebd9b99
Commit
5ebd9b99
authored
Dec 04, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MP4: check more i_timescale values to avoid Division by Zero
Ref #7838
parent
d68da462
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+15
-6
No files found.
modules/demux/mp4/mp4.c
View file @
5ebd9b99
...
...
@@ -216,10 +216,15 @@ static int LoadInitFrag( demux_t *p_demux, const bool b_smooth )
if
(
p_stra
&&
p_stra
->
data
.
p_stra
->
i_track_ID
)
p_sys
->
i_tracks
++
;
/* Get timescale and duration of the video track; */
if
(
!
p_sys
->
i_timescale
)
if
(
p_sys
->
i_timescale
==
0
)
{
p_sys
->
i_timescale
=
p_stra
->
data
.
p_stra
->
i_timescale
;
p_sys
->
i_duration
=
p_stra
->
data
.
p_stra
->
i_duration
;
if
(
p_sys
->
i_timescale
==
0
)
{
msg_Err
(
p_demux
,
"bad timescale"
);
goto
LoadInitFragError
;
}
}
}
}
...
...
@@ -1883,7 +1888,7 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
"(%u), making both equal (report any problem)."
,
p_track
->
i_timescale
,
p_soun
->
i_sampleratehi
);
if
(
p_soun
->
i_sampleratehi
)
if
(
p_soun
->
i_sampleratehi
!=
0
)
p_track
->
i_timescale
=
p_soun
->
i_sampleratehi
;
else
p_soun
->
i_sampleratehi
=
p_track
->
i_timescale
;
...
...
@@ -2497,7 +2502,7 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
}
p_track
->
i_timescale
=
p_mdhd
->
data
.
p_mdhd
->
i_timescale
;
if
(
!
p_track
->
i_timescale
)
if
(
p_track
->
i_timescale
==
0
)
return
;
if
(
p_mdhd
->
data
.
p_mdhd
->
i_language_code
<
0x800
)
...
...
@@ -3440,10 +3445,14 @@ static int MP4_frg_GetChunk( demux_t *p_demux, MP4_Box_t *p_chunk, unsigned *i_t
{
MP4_Box_data_sidx_t
*
p_sidx_data
=
p_sidx
->
data
.
p_sidx
;
assert
(
p_sidx_data
->
i_reference_count
==
1
);
if
(
p_sidx_data
->
i_timescale
==
0
)
return
VLC_EGENERIC
;
unsigned
i_chunk_duration
=
p_sidx_data
->
p_items
[
0
].
i_subsegment_duration
/
p_sidx_data
->
i_timescale
;
default_duration
=
i_chunk_duration
*
p_track
->
i_timescale
/
ret
->
i_sample_count
;
p_sidx_data
->
i_timescale
;
default_duration
=
i_chunk_duration
*
p_track
->
i_timescale
/
ret
->
i_sample_count
;
}
}
...
...
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