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
4c3f3f82
Commit
4c3f3f82
authored
Apr 14, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: mp4: fix mdat box reading
parent
ad92c4f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+14
-2
No files found.
modules/demux/mp4/mp4.c
View file @
4c3f3f82
...
...
@@ -3771,11 +3771,16 @@ static int MP4_frg_GetChunk( demux_t *p_demux, MP4_Box_t *p_chunk, unsigned *i_t
if
(
!
ret
->
p_sample_data
)
return
VLC_ENOMEM
;
uint32_t
dur
=
0
,
len
;
uint32_t
dur
=
0
,
i_mdatlen
=
0
,
len
;
uint32_t
chunk_duration
=
0
,
chunk_size
=
0
;
/* Skip header of mdat */
stream_Read
(
p_demux
->
s
,
NULL
,
8
);
uint8_t
mdat
[
8
];
int
i_read
=
stream_Read
(
p_demux
->
s
,
&
mdat
,
8
);
i_mdatlen
=
GetDWBE
(
mdat
);
if
(
i_read
<
8
||
i_mdatlen
<
8
||
VLC_FOURCC
(
mdat
[
4
],
mdat
[
5
],
mdat
[
6
],
mdat
[
7
]
)
!=
ATOM_mdat
)
return
VLC_EGENERIC
;
for
(
uint32_t
i
=
0
;
i
<
ret
->
i_sample_count
;
i
++
)
{
...
...
@@ -3799,6 +3804,9 @@ static int MP4_frg_GetChunk( demux_t *p_demux, MP4_Box_t *p_chunk, unsigned *i_t
else
len
=
ret
->
p_sample_size
[
i
]
=
default_size
;
if
(
chunk_size
+
len
>
(
i_mdatlen
-
8
)
)
return
VLC_EGENERIC
;
ret
->
p_sample_data
[
i
]
=
malloc
(
len
);
if
(
ret
->
p_sample_data
[
i
]
==
NULL
)
return
VLC_ENOMEM
;
...
...
@@ -3814,6 +3822,10 @@ static int MP4_frg_GetChunk( demux_t *p_demux, MP4_Box_t *p_chunk, unsigned *i_t
p_track
->
fmt
.
i_cat
==
VIDEO_ES
)
ReInitDecoder
(
p_demux
,
p_track
);
/* Skip if we didn't reach the end of mdat box */
if
(
chunk_size
<
(
i_mdatlen
-
8
)
)
stream_ReadU32
(
p_demux
->
s
,
NULL
,
i_mdatlen
-
chunk_size
-
8
);
p_track
->
b_has_non_empty_cchunk
=
true
;
return
VLC_SUCCESS
;
}
...
...
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