Merge "M3UParser: check for NULL before setting meta data" into lmp-dev
diff --git a/media/libstagefright/httplive/M3UParser.cpp b/media/libstagefright/httplive/M3UParser.cpp
index 4f7668c..efd852c 100644
--- a/media/libstagefright/httplive/M3UParser.cpp
+++ b/media/libstagefright/httplive/M3UParser.cpp
@@ -730,6 +730,9 @@
 
             key.tolower();
             const AString &codecs = unquoteString(val);
+            if (meta->get() == NULL) {
+                *meta = new AMessage;
+            }
             (*meta)->setString(key.c_str(), codecs.c_str());
         } else if (!strcasecmp("audio", key.c_str())
                 || !strcasecmp("video", key.c_str())
@@ -753,6 +756,9 @@
             }
 
             key.tolower();
+            if (meta->get() == NULL) {
+                *meta = new AMessage;
+            }
             (*meta)->setString(key.c_str(), groupID.c_str());
         }
     }