FLV: Ignore invalid SCRIPTDATA name type, rather than fail playback

Issue: #7675
PiperOrigin-RevId: 323371286
This commit is contained in:
olly 2020-07-27 17:04:23 +01:00 committed by Oliver Woodman
parent 67408ca7fb
commit 7edc4b1f1e
2 changed files with 5 additions and 4 deletions

View file

@ -206,6 +206,8 @@
* Ogg: Allow non-contiguous pages
([#7230](https://github.com/google/ExoPlayer/issues/7230)).
* Matroska: Remove support for "Invisible" block header flag.
* FLV: Ignore SCRIPTDATA segments with invalid name types, rather than failing
playback ([#7675](https://github.com/google/ExoPlayer/issues/7675)).
* Extractors:
* Add `IndexSeeker` for accurate seeks in VBR MP3 streams
([#6787](https://github.com/google/ExoPlayer/issues/6787)). This seeker

View file

@ -17,7 +17,6 @@ package com.google.android.exoplayer2.extractor.flv;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.extractor.DummyTrackOutput;
import com.google.android.exoplayer2.util.ParsableByteArray;
import java.util.ArrayList;
@ -65,11 +64,11 @@ import java.util.Map;
}
@Override
protected boolean parsePayload(ParsableByteArray data, long timeUs) throws ParserException {
protected boolean parsePayload(ParsableByteArray data, long timeUs) {
int nameType = readAmfType(data);
if (nameType != AMF_TYPE_STRING) {
// Should never happen.
throw new ParserException();
// Ignore segments with unexpected name type.
return false;
}
String name = readAmfString(data);
if (!NAME_METADATA.equals(name)) {