Skip to content

Crash in TextRenderer when rendering stream with single subtitle #8017

@baconz

Description

@baconz

[REQUIRED] Issue description

We get an NPE in 2.12.0 when the TextRenderer tries to render a stream with a single subtitle:

     Caused by: java.lang.NullPointerException: throw with null exception
        at com.google.android.exoplayer2.util.Assertions.checkNotNull(Assertions.java:147)
        at com.google.android.exoplayer2.text.TextRenderer.getNextEventTime(TextRenderer.java:328)
        at com.google.android.exoplayer2.text.TextRenderer.render(TextRenderer.java:201)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:892)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:467)
        at android.os.Handler.dispatchMessage(Handler.java:101) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.os.HandlerThread.run(HandlerThread.java:65) 

I think this was introduced with the null checks added here: 0efec5f#diff-2a869b1d2a8dabec5def4e6e02d2bd18

It is possible to call getNextEventTime() on the first render() if nextSubtitle.isEndOfStream().

[REQUIRED] Reproduction steps

It is difficult for us to share a stream in the clear that reproduces this.

[REQUIRED] Link to test content

See above.

[REQUIRED] A full bug report captured from the device

Happy to do this upon request.

[REQUIRED] Version of ExoPlayer being used

2.12.0

[REQUIRED] Device(s) and version(s) of Android being used

Any

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions