From 92dad5395228d5d40d0ef2b204f576b9c26825be Mon Sep 17 00:00:00 2001 From: Carl 4 Larsson Date: Tue, 12 May 2015 10:00:26 +0200 Subject: [PATCH] Add nullcheck for DASHISOParser Adds a nullcheck for parseBox in DASHISOParser to avoid a nullpointer exception that has been observed. --- .../android/media/internal/mpegdash/DASHISOParser.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/src/main/java/com/sonymobile/android/media/internal/mpegdash/DASHISOParser.java b/library/src/main/java/com/sonymobile/android/media/internal/mpegdash/DASHISOParser.java index c134c07..9817ed3 100644 --- a/library/src/main/java/com/sonymobile/android/media/internal/mpegdash/DASHISOParser.java +++ b/library/src/main/java/com/sonymobile/android/media/internal/mpegdash/DASHISOParser.java @@ -213,6 +213,9 @@ private int parseBox12(BoxHeader nextHeader) { @Override protected boolean parseBox(BoxHeader header) { + if (header == null) { + return false; + } if (header.boxType == BOX_ID_SUBS) { int boxSize = (int)(header.boxHeaderSize + header.boxDataSize); mSubs = new byte[(int)(header.boxHeaderSize + header.boxDataSize)];