mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
TS EsInfo: Be robust against a invalid descriptor length
Issue: Issue: #7722 PiperOrigin-RevId: 325431839
This commit is contained in:
parent
03a1a3ee82
commit
7f6940fb8b
@ -666,6 +666,10 @@ public final class TsExtractor implements Extractor {
|
|||||||
int descriptorTag = data.readUnsignedByte();
|
int descriptorTag = data.readUnsignedByte();
|
||||||
int descriptorLength = data.readUnsignedByte();
|
int descriptorLength = data.readUnsignedByte();
|
||||||
int positionOfNextDescriptor = data.getPosition() + descriptorLength;
|
int positionOfNextDescriptor = data.getPosition() + descriptorLength;
|
||||||
|
if (positionOfNextDescriptor > descriptorsEndPosition) {
|
||||||
|
// Descriptor claims to extend past the end position. Skip it.
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (descriptorTag == TS_PMT_DESC_REGISTRATION) { // registration_descriptor
|
if (descriptorTag == TS_PMT_DESC_REGISTRATION) { // registration_descriptor
|
||||||
long formatIdentifier = data.readUnsignedInt();
|
long formatIdentifier = data.readUnsignedInt();
|
||||||
if (formatIdentifier == AC3_FORMAT_IDENTIFIER) {
|
if (formatIdentifier == AC3_FORMAT_IDENTIFIER) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user