Skip to content

Commit

Permalink
Fix potential null pointer dereferences in EITHelper::AddEIT.
Browse files Browse the repository at this point in the history
Ensure that a ContentDescriptor is valid before trying to extract data
from it.  If its invalid, use "unknown" for the category type instead
of dereferencing a nullptr.
  • Loading branch information
linuxdude42 committed Jan 4, 2025
1 parent d1dfbc8 commit 227ee35
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mythtv/libs/libmythtv/eithelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,11 +701,16 @@ void EITHelper::AddEIT(const PremiereContentInformationTable *cit)
category = QObject::tr("Sports");
}
}
else
else if (content.IsValid())
{
category_type = content.GetMythCategory(0);
category = content.GetDescription(0);
}
else
{
category_type = ProgramInfo::kCategoryNone;
category = "Unknown";
}
}

uint tableid = cit->TableID();
Expand Down

0 comments on commit 227ee35

Please sign in to comment.