am c45d3ad0: Merge "The .mkv parser lib leaves some tracks NULL if it doesn\'t support them." into honeycomb
* commit 'c45d3ad08469eb4c519a5aeef74f6d914e674144':
The .mkv parser lib leaves some tracks NULL if it doesn't support them.
diff --git a/media/libstagefright/matroska/MatroskaExtractor.cpp b/media/libstagefright/matroska/MatroskaExtractor.cpp
index eca9ed6..733de92b 100644
--- a/media/libstagefright/matroska/MatroskaExtractor.cpp
+++ b/media/libstagefright/matroska/MatroskaExtractor.cpp
@@ -707,6 +707,12 @@
for (size_t index = 0; index < tracks->GetTracksCount(); ++index) {
const mkvparser::Track *track = tracks->GetTrackByIndex(index);
+ if (track == NULL) {
+ // Apparently this is currently valid (if unexpected) behaviour
+ // of the mkv parser lib.
+ continue;
+ }
+
const char *const codecID = track->GetCodecId();
LOGV("codec id = %s", codecID);
LOGV("codec name = %s", track->GetCodecNameAsUTF8());