[vlc-devel] [PATCH 11/13] dash: fixed segfault when period is null
Christopher at mailsrv.uni-klu.ac.at
Christopher at mailsrv.uni-klu.ac.at
Sat Feb 11 12:00:02 CET 2012
From: Christopher Mueller <christopher.mueller at itec.aau.at>
---
.../stream_filter/dash/mpd/IsoffMainManager.cpp | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/modules/stream_filter/dash/mpd/IsoffMainManager.cpp b/modules/stream_filter/dash/mpd/IsoffMainManager.cpp
index 480f9f4..9fa2cde 100644
--- a/modules/stream_filter/dash/mpd/IsoffMainManager.cpp
+++ b/modules/stream_filter/dash/mpd/IsoffMainManager.cpp
@@ -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;
--
1.7.0.4
More information about the vlc-devel
mailing list