Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Re-organise some things to stop Coverity et al warning about possible…

… null pointer dereferences in mythfrontend.
  • Loading branch information...
commit 502f0b0538863e6f1501d0aa2ac673c0ff816294 1 parent 8497403
@stuartm stuartm authored
View
2  mythtv/programs/mythfrontend/playbackbox.cpp
@@ -981,7 +981,7 @@ void PlaybackBox::ItemVisible(MythUIButtonListItem *item)
item->DisplayState(extract_commflag_state(*pginfo), "commflagged");
MythUIButtonListItem *sel_item = item->parent()->GetItemCurrent();
- if ((item != sel_item) && pginfo && item->GetImage("preview").isEmpty() &&
+ if ((item != sel_item) && item->GetImage("preview").isEmpty() &&
(asAvailable == pginfo->GetAvailableStatus()))
{
QString token = m_helper.GetPreviewImage(*pginfo, true);
View
12 mythtv/programs/mythfrontend/videodlg.cpp
@@ -109,7 +109,7 @@ namespace
if (item)
return item->GetData().value<MythGenericTree *>();
- return 0;
+ return NULL;
}
VideoMetadata *GetMetadataPtrFromNode(MythGenericTree *node)
@@ -117,7 +117,7 @@ namespace
if (node)
return node->GetData().value<TreeNodeData>().GetMetadata();
- return 0;
+ return NULL;
}
bool GetLocalVideoImage(const QString &video_uid, const QString &filename,
@@ -2345,7 +2345,7 @@ void VideoDialog::VideoMenu()
MythUIButtonListItem *item = GetItemCurrent();
MythGenericTree *node = GetNodePtrFromButton(item);
- if (node && node->getInt() >= 0)
+ if (metadata)
{
if (!metadata->GetTrailer().isEmpty() ||
gCoreContext->GetNumSetting("mythvideo.TrailersRandomEnabled", 0) ||
@@ -2361,8 +2361,10 @@ void VideoDialog::VideoMenu()
menu->AddItem(tr("Change Video Details"), NULL, CreateManageMenu());
menu->AddItem(tr("Delete"), SLOT(RemoveVideo()));
}
- if (node && !(node->getInt() >= 0) && node->getInt() != kUpFolder)
+ else if (node && node->getInt() != kUpFolder)
+ {
menu->AddItem(tr("Play Folder"), SLOT(playFolder()));
+ }
m_menuPopup = new MythDialogBox(menu, m_popupStack, "videomenupopup");
@@ -3182,7 +3184,7 @@ VideoMetadata *VideoDialog::GetMetadata(MythUIButtonListItem *item)
int nodeInt = node->getInt();
if (nodeInt >= 0)
- metadata = GetMetadataPtrFromNode(node);
+ metadata = GetMetadataPtrFromNode(node);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.