Commit 4c096505 by ojw28 Committed by GitHub

Merge pull request #2688 from tylerjroach/dev-v2-NALU-OOM-Fix

Fix potential OOM that can occur reading first NAL packet before seq header
parents 2e25eecf 3b4d9818
...@@ -93,7 +93,7 @@ import com.google.android.exoplayer2.video.AvcConfig; ...@@ -93,7 +93,7 @@ import com.google.android.exoplayer2.video.AvcConfig;
avcConfig.initializationData, Format.NO_VALUE, avcConfig.pixelWidthAspectRatio, null); avcConfig.initializationData, Format.NO_VALUE, avcConfig.pixelWidthAspectRatio, null);
output.format(format); output.format(format);
hasOutputFormat = true; hasOutputFormat = true;
} else if (packetType == AVC_PACKET_TYPE_AVC_NALU) { } else if (packetType == AVC_PACKET_TYPE_AVC_NALU && hasOutputFormat) {
// TODO: Deduplicate with Mp4Extractor. // TODO: Deduplicate with Mp4Extractor.
// Zero the top three bytes of the array that we'll use to decode nal unit lengths, in case // Zero the top three bytes of the array that we'll use to decode nal unit lengths, in case
// they're only 1 or 2 bytes long. // they're only 1 or 2 bytes long.
......
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