Fix saiz and senc sample count checks for FMP4
Issue: #7592 PiperOrigin-RevId: 320556981
This commit is contained in:
parent
4633a63546
commit
3b7669ff72
@ -1,5 +1,13 @@
|
|||||||
# Release notes #
|
# Release notes #
|
||||||
|
|
||||||
|
### 2.11.8 (2020-08-25) ###
|
||||||
|
|
||||||
|
* MP4: Add support for `piff` and `isml` brands
|
||||||
|
([#7584](https://github.com/google/ExoPlayer/issues/7584)).
|
||||||
|
* FMP4: Fix `saiz` and `senc` sample count checks, resolving a "length
|
||||||
|
mismatch" `ParserException` when playing certain protected FMP4 streams
|
||||||
|
([#7592](https://github.com/google/ExoPlayer/issues/7592)).
|
||||||
|
|
||||||
### 2.11.7 (2020-06-29) ###
|
### 2.11.7 (2020-06-29) ###
|
||||||
|
|
||||||
* IMA extension: Fix the way postroll "content complete" notifications are
|
* IMA extension: Fix the way postroll "content complete" notifications are
|
||||||
|
@ -798,8 +798,12 @@ public class FragmentedMp4Extractor implements Extractor {
|
|||||||
int defaultSampleInfoSize = saiz.readUnsignedByte();
|
int defaultSampleInfoSize = saiz.readUnsignedByte();
|
||||||
|
|
||||||
int sampleCount = saiz.readUnsignedIntToInt();
|
int sampleCount = saiz.readUnsignedIntToInt();
|
||||||
if (sampleCount != out.sampleCount) {
|
if (sampleCount > out.sampleCount) {
|
||||||
throw new ParserException("Length mismatch: " + sampleCount + ", " + out.sampleCount);
|
throw new ParserException(
|
||||||
|
"Saiz sample count "
|
||||||
|
+ sampleCount
|
||||||
|
+ " is greater than fragment sample count"
|
||||||
|
+ out.sampleCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
int totalSize = 0;
|
int totalSize = 0;
|
||||||
@ -815,7 +819,10 @@ public class FragmentedMp4Extractor implements Extractor {
|
|||||||
totalSize += defaultSampleInfoSize * sampleCount;
|
totalSize += defaultSampleInfoSize * sampleCount;
|
||||||
Arrays.fill(out.sampleHasSubsampleEncryptionTable, 0, sampleCount, subsampleEncryption);
|
Arrays.fill(out.sampleHasSubsampleEncryptionTable, 0, sampleCount, subsampleEncryption);
|
||||||
}
|
}
|
||||||
out.initEncryptionData(totalSize);
|
Arrays.fill(out.sampleHasSubsampleEncryptionTable, sampleCount, out.sampleCount, false);
|
||||||
|
if (totalSize > 0) {
|
||||||
|
out.initEncryptionData(totalSize);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1055,8 +1062,16 @@ public class FragmentedMp4Extractor implements Extractor {
|
|||||||
|
|
||||||
boolean subsampleEncryption = (flags & 0x02 /* use_subsample_encryption */) != 0;
|
boolean subsampleEncryption = (flags & 0x02 /* use_subsample_encryption */) != 0;
|
||||||
int sampleCount = senc.readUnsignedIntToInt();
|
int sampleCount = senc.readUnsignedIntToInt();
|
||||||
if (sampleCount != out.sampleCount) {
|
if (sampleCount == 0) {
|
||||||
throw new ParserException("Length mismatch: " + sampleCount + ", " + out.sampleCount);
|
// 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);
|
Arrays.fill(out.sampleHasSubsampleEncryptionTable, 0, sampleCount, subsampleEncryption);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user