diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 6a15e4775..0592347ff 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -706,8 +706,6 @@ record_error_msg_t CRecordInstance::MakeFileName(CZapitChannel * channel) MakeExtFileName(channel, ext_file_name); strcpy(&(filename[pos]), UTF8_TO_FILESYSTEM_ENCODING(ext_file_name.c_str())); - pos = strlen(filename); - if(autoshift) strncat(filename, "_temp",FILENAMEBUFFERSIZE - strlen(filename)-1); diff --git a/src/gui/audio_select.cpp b/src/gui/audio_select.cpp index 51935640b..8d2adfba9 100644 --- a/src/gui/audio_select.cpp +++ b/src/gui/audio_select.cpp @@ -198,7 +198,7 @@ int CAudioSelectMenuHandler::doMenu () /* setting volume percent to zapit with channel_id/apid = 0 means current channel and pid */ CVolume::getInstance()->SetCurrentChannel(0); CVolume::getInstance()->SetCurrentPid(0); - int percent[p_count]; + int percent[p_count+1];//+1 avoid zero size for (uint i=0; i < p_count; i++) { percent[i] = CZapit::getInstance()->GetPidVolume(0, g_RemoteControl->current_PIDs.APIDs[i].pid, g_RemoteControl->current_PIDs.APIDs[i].is_ac3); AudioSelector.addItem(new CMenuOptionNumberChooser(g_RemoteControl->current_PIDs.APIDs[i].desc, diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 1bb805dd2..37320e3df 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -717,9 +717,9 @@ void CBouquetList::paint() int ypos = y+ theight; int sb = fheight* listmaxshow; frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - - int sbc= ((bsize - 1)/ listmaxshow)+ 1; /* bsize is > 0, so sbc is also > 0 */ - int sbs= (selected/listmaxshow); + int listmaxshow_tmp = listmaxshow ? listmaxshow : 1;//avoid division by zero + int sbc= ((bsize - 1)/ listmaxshow_tmp)+ 1; /* bsize is > 0, so sbc is also > 0 */ + int sbs= (selected/listmaxshow_tmp); frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); } diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index f3bf6b45f..3a7f44ab3 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -682,9 +682,12 @@ int CLuaInstance::GCWindow(lua_State *L) else if (videoDecoder->getBlank()) CLuaInstVideo::getInstance()->channelRezap(L); - delete w->fbwin; - w->rcinput = NULL; - delete w; + if(w){ + if(w->fbwin) + delete w->fbwin; + w->rcinput = NULL; + delete w; + } return 0; } diff --git a/src/gui/widget/shellwindow.cpp b/src/gui/widget/shellwindow.cpp index 60eab7cb3..4147fb717 100644 --- a/src/gui/widget/shellwindow.cpp +++ b/src/gui/widget/shellwindow.cpp @@ -233,7 +233,7 @@ void CShellWindow::showResult() show_button = true; } else if (mode & ACKNOWLEDGE_EVENT){ - if (*res != 0){ + if (res && *res != 0){ OnResultError(res); if (OnResultError.empty()) DisplayErrorMessage("Error while execution of task. Please see window for details!"); diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index cfb3e448b..6cf7d90d5 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -2638,14 +2638,13 @@ bool CZapitSdtMonitor::Stop() void CZapitSdtMonitor::run() { - time_t /*tstart,*/ tcur, wtime = 0; + time_t /*tstart,*/ tcur = 0, wtime = 0; t_transport_stream_id transport_stream_id = 0; t_original_network_id original_network_id = 0; t_satellite_position satellitePosition = 0; freq_id_t freq = 0; transponder_id_t tpid = 0; - tcur = time(0); //tstart = time(0); sdt_tp.clear(); printf("[zapit] sdt monitor started\n");