mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix ArrayIndexOutOfBoundsException while reading SEI NAL unit
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=147165453
This commit is contained in:
parent
ef475eb9c9
commit
f7fbbe993e
1 changed files with 3 additions and 3 deletions
|
|
@ -1087,12 +1087,12 @@ public final class FragmentedMp4Extractor implements Extractor {
|
||||||
sampleBytesWritten += 4;
|
sampleBytesWritten += 4;
|
||||||
sampleSize += nalUnitLengthFieldLengthDiff;
|
sampleSize += nalUnitLengthFieldLengthDiff;
|
||||||
if (cea608TrackOutput != null) {
|
if (cea608TrackOutput != null) {
|
||||||
byte[] nalPayloadData = nalPayload.data;
|
|
||||||
// Peek the NAL unit type byte.
|
// Peek the NAL unit type byte.
|
||||||
input.peekFully(nalPayloadData, 0, 1);
|
input.peekFully(nalPayload.data, 0, 1);
|
||||||
if ((nalPayloadData[0] & 0x1F) == NAL_UNIT_TYPE_SEI) {
|
if ((nalPayload.data[0] & 0x1F) == NAL_UNIT_TYPE_SEI) {
|
||||||
// Read the whole SEI NAL unit into nalWrapper, including the NAL unit type byte.
|
// Read the whole SEI NAL unit into nalWrapper, including the NAL unit type byte.
|
||||||
nalPayload.reset(sampleCurrentNalBytesRemaining);
|
nalPayload.reset(sampleCurrentNalBytesRemaining);
|
||||||
|
byte[] nalPayloadData = nalPayload.data;
|
||||||
input.readFully(nalPayloadData, 0, sampleCurrentNalBytesRemaining);
|
input.readFully(nalPayloadData, 0, sampleCurrentNalBytesRemaining);
|
||||||
// Write the SEI unit straight to the output.
|
// Write the SEI unit straight to the output.
|
||||||
output.sampleData(nalPayload, sampleCurrentNalBytesRemaining);
|
output.sampleData(nalPayload, sampleCurrentNalBytesRemaining);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue