summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorRonghua Wu <ronghuawu@google.com>2015-08-11 13:33:49 -0700
committerRonghua Wu <ronghuawu@google.com>2015-10-13 15:29:42 +0000
commitc024de3c946c18e8e4799eb8d372fdec3146f8cf (patch)
treec61debd22a7fa92038454b29822814b919a048c0 /media
parentc1c462cbaa8b65c6240f947de503619482296222 (diff)
downloadframeworks_base-c024de3c946c18e8e4799eb8d372fdec3146f8cf.zip
frameworks_base-c024de3c946c18e8e4799eb8d372fdec3146f8cf.tar.gz
frameworks_base-c024de3c946c18e8e4799eb8d372fdec3146f8cf.tar.bz2
media: ignore null InputStream
Bug: 22854896 Change-Id: I20b9e28bbba6dec73538ee6937d337c2e2b971f4
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/MediaPlayer.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index 13b2878..2e82e2f 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -2243,10 +2243,14 @@ public class MediaPlayer implements SubtitleController.Listener
final InputStream fIs = is;
final MediaFormat fFormat = format;
- // Ensure all input streams are closed. It is also a handy
- // way to implement timeouts in the future.
- synchronized(mOpenSubtitleSources) {
- mOpenSubtitleSources.add(is);
+ if (is != null) {
+ // Ensure all input streams are closed. It is also a handy
+ // way to implement timeouts in the future.
+ synchronized(mOpenSubtitleSources) {
+ mOpenSubtitleSources.add(is);
+ }
+ } else {
+ Log.w(TAG, "addSubtitleSource called with null InputStream");
}
// process each subtitle in its own thread