Permalink
Browse files

Fix segfault in mythfrontend following [bff1559]

  • Loading branch information...
stuartm committed Apr 13, 2013
1 parent bff1559 commit 1252fe51af087927b0d6e5c1551dadbbd8f7dd6b
Showing with 4 additions and 2 deletions.
  1. +4 −2 mythtv/libs/libmyth/programinfo.cpp
@@ -83,22 +83,24 @@ static void set_flag(uint32_t &flags, int flag_to_set, bool is_set)
QString myth_category_type_to_string(ProgramInfo::CategoryType category_type)
{
static int NUM_CAT_TYPES = 5;
static const char *cattype[] =
{ "", "movie", "series", "sports", "tvshow", };
if ((category_type > ProgramInfo::kCategoryNone) &&
(category_type < sizeof(cattype)))
((int)category_type < NUM_CAT_TYPES))
return QString(cattype[category_type]);
return "";
}
ProgramInfo::CategoryType string_to_myth_category_type(const QString &category_type)
{
static int NUM_CAT_TYPES = 5;
static const char *cattype[] =
{ "", "movie", "series", "sports", "tvshow", };
for (uint i = 1; i < 5; i++)
for (uint i = 1; i < NUM_CAT_TYPES; i++)
if (category_type == cattype[i])
return (ProgramInfo::CategoryType) i;
return ProgramInfo::kCategoryNone;

0 comments on commit 1252fe5

Please sign in to comment.