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
c29fc945
authored
Jul 10, 2020
by
kimvde
Committed by
kim-vde
Jul 10, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix saiz and senc sample count checks for FMP4
Issue: #7592 PiperOrigin-RevId: 320556981
parent
fd3e10ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java
library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java
View file @
c29fc945
...
...
@@ -809,8 +809,12 @@ public class FragmentedMp4Extractor implements Extractor {
int
defaultSampleInfoSize
=
saiz
.
readUnsignedByte
();
int
sampleCount
=
saiz
.
readUnsignedIntToInt
();
if
(
sampleCount
!=
out
.
sampleCount
)
{
throw
new
ParserException
(
"Length mismatch: "
+
sampleCount
+
", "
+
out
.
sampleCount
);
if
(
sampleCount
>
out
.
sampleCount
)
{
throw
new
ParserException
(
"Saiz sample count "
+
sampleCount
+
" is greater than fragment sample count"
+
out
.
sampleCount
);
}
int
totalSize
=
0
;
...
...
@@ -826,7 +830,10 @@ public class FragmentedMp4Extractor implements Extractor {
totalSize
+=
defaultSampleInfoSize
*
sampleCount
;
Arrays
.
fill
(
out
.
sampleHasSubsampleEncryptionTable
,
0
,
sampleCount
,
subsampleEncryption
);
}
out
.
initEncryptionData
(
totalSize
);
Arrays
.
fill
(
out
.
sampleHasSubsampleEncryptionTable
,
sampleCount
,
out
.
sampleCount
,
false
);
if
(
totalSize
>
0
)
{
out
.
initEncryptionData
(
totalSize
);
}
}
/**
...
...
@@ -1068,8 +1075,16 @@ public class FragmentedMp4Extractor implements Extractor {
boolean
subsampleEncryption
=
(
flags
&
0x02
/* use_subsample_encryption */
)
!=
0
;
int
sampleCount
=
senc
.
readUnsignedIntToInt
();
if
(
sampleCount
!=
out
.
sampleCount
)
{
throw
new
ParserException
(
"Length mismatch: "
+
sampleCount
+
", "
+
out
.
sampleCount
);
if
(
sampleCount
==
0
)
{
// Samples are unencrypted.
Arrays
.
fill
(
out
.
sampleHasSubsampleEncryptionTable
,
0
,
out
.
sampleCount
,
false
);
return
;
}
else
if
(
sampleCount
!=
out
.
sampleCount
)
{
throw
new
ParserException
(
"Senc sample count "
+
sampleCount
+
" is different from fragment sample count"
+
out
.
sampleCount
);
}
Arrays
.
fill
(
out
.
sampleHasSubsampleEncryptionTable
,
0
,
sampleCount
,
subsampleEncryption
);
...
...
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