Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6b03e6a1
authored
Jul 22, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix MP4+MKV sniffing to handle empty atoms / EBML elements.
Issue: #641
parent
648f224d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
library/src/main/java/com/google/android/exoplayer/extractor/mp4/Sniffer.java
library/src/main/java/com/google/android/exoplayer/extractor/webm/Sniffer.java
library/src/main/java/com/google/android/exoplayer/extractor/webm/WebmExtractor.java
library/src/main/java/com/google/android/exoplayer/extractor/mp4/Sniffer.java
View file @
6b03e6a1
...
...
@@ -102,7 +102,7 @@ import java.io.IOException;
atomSize
=
buffer
.
readLong
();
}
// Check the atom size is large enough to include its header.
if
(
atomSize
<
=
headerSize
||
atomSize
>
Integer
.
MAX_VALUE
)
{
if
(
atomSize
<
headerSize
||
atomSize
>
Integer
.
MAX_VALUE
)
{
return
false
;
}
// Stop searching if reading this atom would exceed the search limit.
...
...
@@ -129,7 +129,7 @@ import java.io.IOException;
}
else
if
(
atomType
==
Atom
.
TYPE_moof
)
{
foundFragment
=
true
;
break
;
}
else
{
}
else
if
(
atomDataSize
!=
0
)
{
input
.
advancePeekPosition
(
atomDataSize
);
}
bytesSearched
+=
atomSize
;
...
...
library/src/main/java/com/google/android/exoplayer/extractor/webm/Sniffer.java
View file @
6b03e6a1
...
...
@@ -76,11 +76,13 @@ import java.io.IOException;
return
false
;
}
long
size
=
readUint
(
input
);
if
(
size
<
=
0
||
size
>
Integer
.
MAX_VALUE
)
{
if
(
size
<
0
||
size
>
Integer
.
MAX_VALUE
)
{
return
false
;
}
input
.
advancePeekPosition
((
int
)
size
);
peekLength
+=
size
;
if
(
size
!=
0
)
{
input
.
advancePeekPosition
((
int
)
size
);
peekLength
+=
size
;
}
}
return
peekLength
==
headerStart
+
headerSize
;
}
...
...
library/src/main/java/com/google/android/exoplayer/extractor/webm/WebmExtractor.java
View file @
6b03e6a1
...
...
@@ -1187,7 +1187,8 @@ public final class WebmExtractor implements Extractor {
System
.
arraycopy
(
NalUnitUtil
.
NAL_START_CODE
,
0
,
buffer
,
bufferPosition
,
NalUnitUtil
.
NAL_START_CODE
.
length
);
bufferPosition
+=
NalUnitUtil
.
NAL_START_CODE
.
length
;
System
.
arraycopy
(
parent
.
data
,
parent
.
getPosition
(),
buffer
,
bufferPosition
,
nalUnitLength
);
System
.
arraycopy
(
parent
.
data
,
parent
.
getPosition
(),
buffer
,
bufferPosition
,
nalUnitLength
);
bufferPosition
+=
nalUnitLength
;
parent
.
skipBytes
(
nalUnitLength
);
}
...
...
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