Commit b2222f8c by vitekn Committed by GitHub

Null pointer exception fixed

pesPayloadReader can be null here because DefaultStreamReader.init() can return null on unknown streamId. If we have a junk transport stream in our content an exception will be thrown.
parent 924a0417
...@@ -467,7 +467,9 @@ public final class TsExtractor implements Extractor { ...@@ -467,7 +467,9 @@ public final class TsExtractor implements Extractor {
pesPayloadReader = id3Reader; pesPayloadReader = id3Reader;
} else { } else {
pesPayloadReader = streamReaderFactory.createStreamReader(streamType, esInfo); pesPayloadReader = streamReaderFactory.createStreamReader(streamType, esInfo);
pesPayloadReader.init(output, new TrackIdGenerator(trackId, MAX_PID_PLUS_ONE)); if (pesPayloadReader != null) {
pesPayloadReader.init(output, new TrackIdGenerator(trackId, MAX_PID_PLUS_ONE));
}
} }
if (pesPayloadReader != null) { if (pesPayloadReader != null) {
......
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