[vlc-commits] dash: fixed segfault when period is null

Christopher Mueller git at videolan.org
Tue Feb 14 17:30:22 CET 2012


vlc | branch: master | Christopher Mueller <christopher.mueller at itec.aau.at> | Sat Feb 11 12:00:02 2012 +0100| [5a3cb1536946b88d8f1887d31b32d2ddabf95c61] | committer: Hugo Beauzée-Luyssen

dash: fixed segfault when period is null

Signed-off-by: Hugo Beauzée-Luyssen <beauze.h at gmail.com>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5a3cb1536946b88d8f1887d31b32d2ddabf95c61
---

 .../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;



More information about the vlc-commits mailing list