[vlc-commits] dash: Fixing SegmentInfoCommon initialization/deletion.
Hugo Beauzée-Luyssen
git at videolan.org
Fri Jan 6 12:40:40 CET 2012
vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Thu Jan 5 18:21:37 2012 +0100| [83b82fc3805b1217cb6204fc4f763550416f0de0] | committer: Jean-Baptiste Kempf
dash: Fixing SegmentInfoCommon initialization/deletion.
This prevents a potential crash, and solves a memory leak.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=83b82fc3805b1217cb6204fc4f763550416f0de0
---
.../stream_filter/dash/mpd/SegmentInfoCommon.cpp | 13 ++++++++++++-
modules/stream_filter/dash/mpd/SegmentInfoCommon.h | 1 +
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/modules/stream_filter/dash/mpd/SegmentInfoCommon.cpp b/modules/stream_filter/dash/mpd/SegmentInfoCommon.cpp
index 0d7c26b..51f3519 100644
--- a/modules/stream_filter/dash/mpd/SegmentInfoCommon.cpp
+++ b/modules/stream_filter/dash/mpd/SegmentInfoCommon.cpp
@@ -24,11 +24,22 @@
#include "SegmentInfoCommon.h"
+#include "Segment.h"
+#include "SegmentTimeline.h"
+
using namespace dash::mpd;
SegmentInfoCommon::SegmentInfoCommon() :
- duration( -1 )
+ duration( -1 ),
+ initialisationSegment( NULL ),
+ segmentTimeline( NULL )
+{
+}
+
+SegmentInfoCommon::~SegmentInfoCommon()
{
+ delete this->segmentTimeline;
+ delete this->initialisationSegment;
}
time_t SegmentInfoCommon::getDuration() const
diff --git a/modules/stream_filter/dash/mpd/SegmentInfoCommon.h b/modules/stream_filter/dash/mpd/SegmentInfoCommon.h
index 654ebfc..d637c4e 100644
--- a/modules/stream_filter/dash/mpd/SegmentInfoCommon.h
+++ b/modules/stream_filter/dash/mpd/SegmentInfoCommon.h
@@ -39,6 +39,7 @@ namespace dash
{
public:
SegmentInfoCommon();
+ virtual ~SegmentInfoCommon();
time_t getDuration() const;
void setDuration( time_t duration );
int getStartIndex() const;
More information about the vlc-commits
mailing list