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
7548510c
Commit
7548510c
authored
Apr 14, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: mp4: fix sample size signedness
parent
64dddc79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+17
-12
No files found.
modules/demux/mp4/mp4.c
View file @
7548510c
...
...
@@ -100,8 +100,8 @@ static void MP4_TrackUnselect(demux_t *, mp4_track_t * );
static
int
MP4_TrackSeek
(
demux_t
*
,
mp4_track_t
*
,
mtime_t
);
static
uint64_t
MP4_TrackGetPos
(
mp4_track_t
*
);
static
int
MP4_TrackSampleSize
(
mp4_track_t
*
,
in
t
*
);
static
int
MP4_TrackNextSample
(
demux_t
*
,
mp4_track_t
*
,
in
t
);
static
uint32_t
MP4_TrackSampleSize
(
mp4_track_t
*
,
uint32_
t
*
);
static
int
MP4_TrackNextSample
(
demux_t
*
,
mp4_track_t
*
,
uint32_
t
);
static
void
MP4_TrackSetELST
(
demux_t
*
,
mp4_track_t
*
,
int64_t
);
static
void
MP4_UpdateSeekpoint
(
demux_t
*
);
...
...
@@ -743,8 +743,8 @@ static int Demux( demux_t *p_demux )
MP4_TrackGetDTS( p_demux, tk ),
MP4_GetMoviePTS( p_sys ) );
#endif
in
t
i_nb_samples
=
0
;
in
t
i_samplessize
=
MP4_TrackSampleSize
(
tk
,
&
i_nb_samples
);
uint32_
t
i_nb_samples
=
0
;
uint32_
t
i_samplessize
=
MP4_TrackSampleSize
(
tk
,
&
i_nb_samples
);
if
(
i_samplessize
>
0
)
{
block_t
*
p_block
;
...
...
@@ -1296,7 +1296,7 @@ static void LoadChapterApple( demux_t *p_demux, mp4_track_t *tk )
{
const
int64_t
i_dts
=
MP4_TrackGetDTS
(
p_demux
,
tk
);
const
int64_t
i_pts_delta
=
MP4_TrackGetPTSDelta
(
p_demux
,
tk
);
in
t
i_nb_samples
=
0
;
uint32_
t
i_nb_samples
=
0
;
const
uint32_t
i_size
=
MP4_TrackSampleSize
(
tk
,
&
i_nb_samples
);
if
(
i_size
>
0
&&
!
stream_Seek
(
p_demux
->
s
,
MP4_TrackGetPos
(
tk
)
)
)
...
...
@@ -3048,9 +3048,9 @@ static int MP4_TrackSeek( demux_t *p_demux, mp4_track_t *p_track,
*
*/
#define QT_V0_MAX_SAMPLES 1024
static
int
MP4_TrackSampleSize
(
mp4_track_t
*
p_track
,
in
t
*
pi_nb_samples
)
static
uint32_t
MP4_TrackSampleSize
(
mp4_track_t
*
p_track
,
uint32_
t
*
pi_nb_samples
)
{
in
t
i_size
;
uint32_
t
i_size
;
MP4_Box_data_sample_soun_t
*
p_soun
;
if
(
p_track
->
i_sample_size
==
0
)
...
...
@@ -3067,11 +3067,15 @@ static int MP4_TrackSampleSize( mp4_track_t *p_track, int *pi_nb_samples )
if
(
p_soun
->
i_qt_version
==
1
)
{
in
t
i_samples
=
p_track
->
chunk
[
p_track
->
i_chunk
].
i_sample_count
;
uint32_
t
i_samples
=
p_track
->
chunk
[
p_track
->
i_chunk
].
i_sample_count
;
if
(
p_track
->
fmt
.
audio
.
i_blockalign
>
1
)
i_samples
=
p_soun
->
i_sample_per_packet
;
i_size
=
i_samples
/
p_soun
->
i_sample_per_packet
*
p_soun
->
i_bytes_per_frame
;
i_size
=
i_samples
/
p_soun
->
i_sample_per_packet
;
if
(
UINT32_MAX
/
i_size
<
p_soun
->
i_bytes_per_frame
)
i_size
*=
p_soun
->
i_bytes_per_frame
;
else
i_size
=
UINT32_MAX
;
}
else
if
(
p_track
->
i_sample_size
>
256
)
{
...
...
@@ -3083,8 +3087,8 @@ static int MP4_TrackSampleSize( mp4_track_t *p_track, int *pi_nb_samples )
{
mp4_chunk_t
*
p_chunk
=
&
p_track
->
chunk
[
p_track
->
i_chunk
];
int64_t
i_length
=
CLOCK_FREQ
/
10
;
int
i_samples
=
1
;
int64_t
i_maxsamples
=
1
;
uint32_t
i_samples
=
0
;
uint32_t
i_maxsamples
=
0
;
for
(
uint32_t
i
=
p_track
->
i_sample
;
i
<
p_chunk
->
i_sample_count
;
i
++
)
{
i_length
-=
CLOCK_FREQ
*
p_chunk
->
p_sample_delta_dts
[
i
]
/
p_track
->
i_timescale
;
...
...
@@ -3094,6 +3098,7 @@ static int MP4_TrackSampleSize( mp4_track_t *p_track, int *pi_nb_samples )
i_samples
=
__MIN
(
QT_V0_MAX_SAMPLES
,
i_samples
);
i_samples
=
__MIN
(
i_maxsamples
,
i_samples
);
if
(
i_samples
==
0
)
i_samples
=
1
;
i_size
=
i_samples
*
p_track
->
i_sample_size
;
*
pi_nb_samples
=
i_samples
;
}
...
...
@@ -3140,7 +3145,7 @@ static uint64_t MP4_TrackGetPos( mp4_track_t *p_track )
return
i_pos
;
}
static
int
MP4_TrackNextSample
(
demux_t
*
p_demux
,
mp4_track_t
*
p_track
,
in
t
i_samples
)
static
int
MP4_TrackNextSample
(
demux_t
*
p_demux
,
mp4_track_t
*
p_track
,
uint32_
t
i_samples
)
{
if
(
p_track
->
fmt
.
i_cat
==
AUDIO_ES
&&
p_track
->
i_sample_size
!=
0
)
{
...
...
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