aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Woo <sascha.woo@gmail.com>2014-07-16 07:54:22 +0200
committerSascha Woo <sascha.woo@gmail.com>2014-07-16 07:54:22 +0200
commit664817607b4943e4c999e9e4677b11190a52ff2e (patch)
tree96ccec3ca215e5fbc3716a98af8d0c03139a406d
parentc5500425b9a75d83f6b25a168364e2d6ba062714 (diff)
parent15dc38c771d2163ebc259e5b29fc5ee8b7e6c12f (diff)
Merge pull request #5037 from xhaggi/fix-epg-stdstring-crash
[epg] fix implicit std::string constructor with NULL argument
-rw-r--r--xbmc/epg/EpgInfoTag.cpp46
-rw-r--r--xbmc/epg/EpgInfoTag.h6
2 files changed, 24 insertions, 28 deletions
diff --git a/xbmc/epg/EpgInfoTag.cpp b/xbmc/epg/EpgInfoTag.cpp
index 4b23ec9706..e2000d1adf 100644
--- a/xbmc/epg/EpgInfoTag.cpp
+++ b/xbmc/epg/EpgInfoTag.cpp
@@ -98,7 +98,30 @@ CEpgInfoTag::CEpgInfoTag(const EPG_TAG &data) :
CPVRTimerInfoTagPtr emptyTimer;
m_timer = emptyTimer;
- Update(data);
+ SetStartFromUTC(data.startTime + g_advancedSettings.m_iPVRTimeCorrection);
+ SetEndFromUTC(data.endTime + g_advancedSettings.m_iPVRTimeCorrection);
+ SetGenre(data.iGenreType, data.iGenreSubType, data.strGenreDescription);
+ SetParentalRating(data.iParentalRating);
+ SetUniqueBroadcastID(data.iUniqueBroadcastId);
+ SetNotify(data.bNotify);
+ SetFirstAiredFromUTC(data.firstAired + g_advancedSettings.m_iPVRTimeCorrection);
+ SetEpisodeNum(data.iEpisodeNumber);
+ SetEpisodePart(data.iEpisodePartNumber);
+ SetStarRating(data.iStarRating);
+
+ // explicit NULL check, because there is no implicit NULL constructor for std::string
+ if (data.strTitle)
+ SetTitle(data.strTitle);
+ if (data.strPlotOutline)
+ SetPlotOutline(data.strPlotOutline);
+ if (data.strPlot)
+ SetPlot(data.strPlot);
+ if (data.strEpisodeName)
+ SetEpisodeName(data.strEpisodeName);
+ if (data.strIconPath)
+ SetIcon(data.strIconPath);
+ if (data.strRecordingId)
+ SetRecordingId(data.strRecordingId);
}
CEpgInfoTag::CEpgInfoTag(const CEpgInfoTag &tag) :
@@ -883,27 +906,6 @@ const PVR::CPVRChannelPtr CEpgInfoTag::ChannelTag(void) const
return m_pvrChannel;
}
-void CEpgInfoTag::Update(const EPG_TAG &tag)
-{
- CSingleLock lock(m_critSection);
- SetStartFromUTC(tag.startTime + g_advancedSettings.m_iPVRTimeCorrection);
- SetEndFromUTC(tag.endTime + g_advancedSettings.m_iPVRTimeCorrection);
- SetTitle(tag.strTitle);
- SetPlotOutline(tag.strPlotOutline);
- SetPlot(tag.strPlot);
- SetGenre(tag.iGenreType, tag.iGenreSubType, tag.strGenreDescription);
- SetParentalRating(tag.iParentalRating);
- SetUniqueBroadcastID(tag.iUniqueBroadcastId);
- SetNotify(tag.bNotify);
- SetFirstAiredFromUTC(tag.firstAired + g_advancedSettings.m_iPVRTimeCorrection);
- SetEpisodeNum(tag.iEpisodeNumber);
- SetEpisodePart(tag.iEpisodePartNumber);
- SetEpisodeName(tag.strEpisodeName);
- SetStarRating(tag.iStarRating);
- SetIcon(tag.strIconPath);
- SetRecordingId(tag.strRecordingId);
-}
-
bool CEpgInfoTag::Update(const CEpgInfoTag &tag, bool bUpdateBroadcastId /* = true */)
{
bool bChanged(false);
diff --git a/xbmc/epg/EpgInfoTag.h b/xbmc/epg/EpgInfoTag.h
index 8e3f98fd6b..3d839fd6be 100644
--- a/xbmc/epg/EpgInfoTag.h
+++ b/xbmc/epg/EpgInfoTag.h
@@ -460,12 +460,6 @@ namespace EPG
/*!
* @brief Update the information in this tag with the info in the given tag.
* @param tag The new info.
- */
- void Update(const EPG_TAG &tag);
-
- /*!
- * @brief Update the information in this tag with the info in the given tag.
- * @param tag The new info.
* @param bUpdateBroadcastId If set to false, the tag BroadcastId (locally unique) will not be chacked/updated
* @return True if something changed, false otherwise.
*/