gui/channellist.cpp: fix p_requested_channels allocate size

Origin commit data
------------------
Branch: ni/coolstream
Commit: 25e4a396d7
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-08-30 (Thu, 30 Aug 2012)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2012-08-30 18:11:14 +04:00
parent 7ff45bcaec
commit 067a0a44c7

View File

@@ -186,17 +186,16 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to)
} }
} else { } else {
t_channel_id *p_requested_channels; t_channel_id *p_requested_channels;
int size_requested_channels = chanlist_size * sizeof(t_channel_id); p_requested_channels = new t_channel_id[chanlist_size];
p_requested_channels = new t_channel_id[size_requested_channels];
if (! p_requested_channels) { if (! p_requested_channels) {
fprintf(stderr,"%s:%d allocation failed!\n", __FUNCTION__, __LINE__); fprintf(stderr,"%s:%d allocation failed!\n", __FUNCTION__, __LINE__);
return; return;
} }
for (uint32_t count = 0; count < chanlist_size; count++) { for (uint32_t count = 0; count < chanlist_size; count++)
p_requested_channels[count] = chanlist[count + from]->channel_id&0xFFFFFFFFFFFFULL; p_requested_channels[count] = chanlist[count + from]->channel_id;
}
CChannelEventList levents; CChannelEventList levents;
CEitManager::getInstance()->getChannelEvents(levents, (CNeutrinoApp::getInstance()->getMode()) != NeutrinoMessages::mode_radio, p_requested_channels, size_requested_channels); CEitManager::getInstance()->getChannelEvents(levents, p_requested_channels, chanlist_size);
for (uint32_t count=0; count < chanlist_size; count++) { for (uint32_t count=0; count < chanlist_size; count++) {
chanlist[count]->currentEvent = CChannelEvent(); chanlist[count]->currentEvent = CChannelEvent();
for (CChannelEventList::iterator e = levents.begin(); e != levents.end(); ++e) { for (CChannelEventList::iterator e = levents.begin(); e != levents.end(); ++e) {