Commit 391a9997 by olly Committed by Oliver Woodman

Fix hypothetical issue with encrypted CEA608

This will never happen in practice, since CEA608 shouldn't be encrypted (and we
can't handle it if it is), but in theory appendSampleEncryptionData can be called,
then skipFully can throw when applying the CEA608 transformation, then when
retrying appendSampleEncryptionData will be called again for the same sample.
appendSampleEncryptionData consumes from trackFragment.sampleEncryptionData, and
so the second time around data is being consumed one sample ahead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189931631
parent 7095a14d
......@@ -1140,16 +1140,16 @@ public final class FragmentedMp4Extractor implements Extractor {
}
sampleSize = currentTrackBundle.fragment
.sampleSizeTable[currentTrackBundle.currentSampleIndex];
if (currentTrackBundle.track.sampleTransformation == Track.TRANSFORMATION_CEA608_CDAT) {
sampleSize -= Atom.HEADER_SIZE;
input.skipFully(Atom.HEADER_SIZE);
}
if (currentTrackBundle.fragment.definesEncryptionData) {
sampleBytesWritten = appendSampleEncryptionData(currentTrackBundle);
sampleSize += sampleBytesWritten;
} else {
sampleBytesWritten = 0;
}
if (currentTrackBundle.track.sampleTransformation == Track.TRANSFORMATION_CEA608_CDAT) {
sampleSize -= Atom.HEADER_SIZE;
input.skipFully(Atom.HEADER_SIZE);
}
parserState = STATE_READING_SAMPLE_CONTINUE;
sampleCurrentNalBytesRemaining = 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment