Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in TextRenderer #2081

Closed
jonfhancock opened this issue Nov 17, 2016 · 2 comments
Closed

NullPointerException in TextRenderer #2081

jonfhancock opened this issue Nov 17, 2016 · 2 comments
Assignees
Labels

Comments

@jonfhancock
Copy link

jonfhancock commented Nov 17, 2016

We are getting an NPE on an HLS video with 608 captions.

The stack trace is:

java.lang.NullPointerException: Attempt to invoke virtual method 'int com.google.android.exoplayer2.text.SubtitleOutputBuffer.getEventTimeCount()' on a null object reference
at com.google.android.exoplayer2.text.TextRenderer.getNextEventTime(TextRenderer.java:252)
at com.google.android.exoplayer2.text.TextRenderer.render(TextRenderer.java:165)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:431)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:265)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)

The method getNextEventTime() should have a null check on subtitle before attempting to call getEventTimeCount(). I am not sure what it should return if subtitle is null. Perhaps C.INDEX_UNSET?

@ojw28
Copy link
Contributor

ojw28 commented Nov 17, 2016

Thanks for the report. I think the problem is more that nextSubtitleEventIndex needs resetting to INDEX_UNSET in a few places.

@ojw28 ojw28 self-assigned this Nov 17, 2016
@ojw28 ojw28 added the bug label Nov 17, 2016
ojw28 added a commit that referenced this issue Nov 18, 2016
Issue: #2081

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139566990
@ojw28
Copy link
Contributor

ojw28 commented Nov 18, 2016

This is fixed in dev-v2.

@ojw28 ojw28 closed this as completed Nov 18, 2016
@google google locked and limited conversation to collaborators Jun 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants