]> git.sesse.net Git - vlc/blobdiff - modules/stream_filter/dash/mpd/IsoffMainManager.cpp
dash: fixed segfault when period is null
[vlc] / modules / stream_filter / dash / mpd / IsoffMainManager.cpp
index 480f9f49fa4f4d82623935c31f23059fd2101509..9fa2cde03fde4ec42a93b9bf4f1ade7b077e3c72 100644 (file)
@@ -89,6 +89,9 @@ Period*                     IsoffMainManager::getFirstPeriod        ()
 }
 Representation*             IsoffMainManager::getRepresentation     (Period *period, int bitrate) const
 {
+    if(period == NULL)
+        return NULL;
+
     std::vector<AdaptationSet *> adaptationSets = period->getAdaptationSets();
 
     Representation  *best = NULL;
@@ -128,6 +131,9 @@ const MPD*                  IsoffMainManager::getMPD                () const
 }
 Representation*             IsoffMainManager::getRepresentation     (Period *period, int bitrate, int width, int height) const
 {
+    if(period == NULL)
+        return NULL;
+
     std::vector<AdaptationSet *> adaptationSets = period->getAdaptationSets();
 
     std::cout << "Searching for best representation with bitrate: " << bitrate << " and resolution: " << width << "x" << height << std::endl;