[vlc-commits] dash: Avoid crashing when there's no SegmentInfo node.

Hugo Beauzée-Luyssen git at videolan.org
Wed Nov 30 01:21:16 CET 2011


vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Mon Nov 28 13:29:03 2011 +0100| [4cd0143206f12e51185195831008858977254ba6] | committer: Jean-Baptiste Kempf

dash: Avoid crashing when there's no SegmentInfo node.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 8c55fe50c102c71ca2e62b3c75d19eee918387ea)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=4cd0143206f12e51185195831008858977254ba6
---

 modules/stream_filter/dash/mpd/BasicCMParser.cpp |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index c1aea0d..dd88fe0 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -96,11 +96,15 @@ void    BasicCMParser::setSegmentInfo       (Node *root, Representation *rep)
 {
     Node    *segmentInfo = DOMHelper::getFirstChildElementByName( root, "SegmentInfo");
 
-    SegmentInfo *info = new SegmentInfo( segmentInfo->getAttributes() );
-    this->setInitSegment( segmentInfo, info );
-    this->setSegments(segmentInfo, info );
-    rep->setSegmentInfo(info);
+    if ( segmentInfo )
+    {
+        SegmentInfo *info = new SegmentInfo( segmentInfo->getAttributes() );
+        this->setInitSegment( segmentInfo, info );
+        this->setSegments(segmentInfo, info );
+        rep->setSegmentInfo(info);
+    }
 }
+
 void    BasicCMParser::setInitSegment       (Node *root, SegmentInfo *info)
 {
     std::vector<Node *> initSeg = DOMHelper::getChildElementByTagName(root, "InitialisationSegmentURL");



More information about the vlc-commits mailing list