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

Fix possible subrip timing line NPE #3185

Merged
merged 1 commit into from
Aug 17, 2017
Merged

Fix possible subrip timing line NPE #3185

merged 1 commit into from
Aug 17, 2017

Conversation

dbrain
Copy link
Contributor

@dbrain dbrain commented Aug 17, 2017

Fixes a possible NPE when reading the subrips timing line. We've had this occur for multiple users. Most likely due to corrupt srts, but would prefer the subs to just not appear in this scenario.

Not sure of your style guide (re: ternary operators), but figured it was tidier to reuse the "matches" check as in both scenarios the timing line is "invalid".

Error seen in the wild (trimmed) is:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference  
       at java.util.regex.Matcher.reset(Matcher.java:995)  
       at java.util.regex.Matcher.<init>(Matcher.java:174)  
       at java.util.regex.Pattern.matcher(Pattern.java:1006)  
       at com.google.android.exoplayer2.text.subrip.SubripDecoder.decode(SubripDecoder.java:72)

@ojw28 ojw28 merged commit 7ddcc46 into google:dev-v2 Aug 17, 2017
@google google locked and limited conversation to collaborators Dec 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants