diff --git a/lib/libmd5sum/md5.c b/lib/libmd5sum/md5.c index e433782e8..aece50d10 100644 --- a/lib/libmd5sum/md5.c +++ b/lib/libmd5sum/md5.c @@ -132,7 +132,7 @@ md5_stream (stream, resblock) /* Important: BLOCKSIZE must be a multiple of 64. */ #define BLOCKSIZE 4096 struct md5_ctx ctx; - char buffer[BLOCKSIZE + 72]; + char buffer[BLOCKSIZE + 72] = {0}; size_t sum; /* Initialize the computation context. */ diff --git a/lib/libtuxtxt/tuxtxt_common.h b/lib/libtuxtxt/tuxtxt_common.h index 52f9d419e..c6e6c7bd8 100644 --- a/lib/libtuxtxt/tuxtxt_common.h +++ b/lib/libtuxtxt/tuxtxt_common.h @@ -704,8 +704,9 @@ void *tuxtxt_CacheThread(void * /*arg*/) tuxtxt_cache.current_subpage[magazine] = -1; continue; } - +#if 0 /* ? */ b1 &= 3; +#endif b3 &= 7; if (tuxtxt_is_dec(tuxtxt_cache.page_receiving)) /* ignore other subpage bits for hex pages */ diff --git a/src/driver/radiotext.cpp b/src/driver/radiotext.cpp index 28f1c8186..b74aa9ef0 100644 --- a/src/driver/radiotext.cpp +++ b/src/driver/radiotext.cpp @@ -836,7 +836,7 @@ void CRadioText::RassDecode(unsigned char *mtext, int len) slidenumr = Rass_SlideFoto; } // - char *filepath; + char *filepath = asprintf(&filepath, "%s/Rass_%d.error", DataDir, slidenumr); (filetype == 2) ? asprintf(&filepath, "%s/Rass_%d.def", DataDir, slidenumr) : asprintf(&filepath, "%s/Rass_%d.mpg", DataDir, slidenumr); if ((fd = fopen(filepath, "wb")) != NULL) { diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 76c7d5cdf..7f17c199d 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -265,7 +265,6 @@ void CEventList::readEvents(const t_channel_id channel_id) void CEventList::getChannelNames(t_channel_id &channel_id, std::string ¤t_channel_name, std::string &prev_channel_name, std::string &next_channel_name, neutrino_msg_t msg) { t_bouquet_id current_bouquet_id = bouquetList->getActiveBouquetNumber(); - t_channel_id channel_id_tmp = channel_id; const unsigned int channel_nr = bouquetList->Bouquets[current_bouquet_id]->channelList->getSize(); if(channel_nr < 2){ channel_id = 0; @@ -274,7 +273,7 @@ void CEventList::getChannelNames(t_channel_id &channel_id, std::string ¤t_ unsigned int tmp_channel = 0; for(unsigned int channel = 0; channel < channel_nr; channel++) { - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); + t_channel_id channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); if(channel_id_tmp == channel_id){ if ( msg==CRCInput::RC_right || msg==CRCInput::RC_forward ) { channel = (channel+1) %channel_nr; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 211cd9fea..c9d76dbda 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -948,7 +948,7 @@ bool CInfoViewer::showLivestreamInfo() CMoviePlayerGui::getInstance().getLivestreamInfo(&livestreamInfo1, &tmp1); if (!(videoDecoder->getBlank())) { - int xres, yres, framerate; + int xres = 0, yres = 0, framerate = 0; std::string tmp2; videoDecoder->getPictureInfo(xres, yres, framerate); switch (framerate) { @@ -977,6 +977,7 @@ bool CInfoViewer::showLivestreamInfo() tmp2 = "60fps"; break; default: + framerate = 0; tmp2 = g_Locale->getText(LOCALE_STREAMINFO_FRAMERATE_UNKNOWN); break; } @@ -1069,7 +1070,6 @@ void CInfoViewer::loop(bool show_dot) //printf("%s:%d: imitate VZAP; RC_left/right\n", __func__, __LINE__); CMoviePlayerGui::getInstance().setFromInfoviewer(true); g_RCInput->postMsg (msg, data); - hideIt = true; } else setSwitchMode(IV_MODE_VIRTUAL_ZAP); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 7553ce221..9ec28dc32 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1504,7 +1504,6 @@ void CMoviePlayerGui::PlayFileLoop(void) disableOsdElements(MUTE); CFileBrowser *playlist = new CFileBrowser(); CFile *pfile = NULL; - pfile = &(*filelist_it); int selected = std::distance( filelist.begin(), filelist_it ); filelist_it = filelist.end(); if (playlist->playlist_manager(filelist, selected)) @@ -2331,7 +2330,7 @@ void CMoviePlayerGui::selectChapter() playback->GetChapters(positions, titles); std::vector playlists; std::vector ptitles; - int current; + int current = 0; playback->GetTitles(playlists, ptitles, current); if (positions.empty() && playlists.empty()) @@ -2484,7 +2483,6 @@ bool CMoviePlayerGui::convertSubtitle(std::string &text) else { memset(buf + (len - olen), 0, olen); text = buf; - ret = true; } free(buf); diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index 12582b865..14a8c433d 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -679,6 +679,7 @@ string COPKGManager::getPkgDescription(std::string pkgName, std::string pkgDesc) return pkgDesc; fpos_t fz; + fz.__pos = 0; fseek(fd, 0, SEEK_END); fgetpos(fd, &fz); fseek(fd, 0, SEEK_SET); diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index a3cb47ae9..7a51f1105 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -644,7 +644,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) snprintf(buf, sizeof(buf), "%s:", g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE)); g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); - int type, layer, freq, mode, lbitrate; + int type = 0, layer = 0, freq = 0, mode = 0, lbitrate = 0; /* audioDecoder->getAudioInfo() seems broken in libcoolstream2. ddmode is always 1 ("CH1/CH2"). diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 18ad88a75..f9f4680cb 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -205,7 +205,7 @@ int paintButtons( const button_label_ext * const content, fprintf(stderr, "PB: sp %d mw %d w_t %d w_i %d w_s %d c_i %d\n", spacing, maxwidth, w_text, w_icons, w_space, count_items); #endif - if (fwidth[cnt - 1] == 0) /* divisor needs to be labels+1 unless rightmost icon has a label */ + if (cnt > 0 && fwidth[cnt - 1] == 0) /* divisor needs to be labels+1 unless rightmost icon has a label */ count_labels++; /* side effect: we don't try to divide by 0 :-) */ if (maximize) { diff --git a/src/gui/widget/helpbox.cpp b/src/gui/widget/helpbox.cpp index fc8989efc..d4fd87b76 100644 --- a/src/gui/widget/helpbox.cpp +++ b/src/gui/widget/helpbox.cpp @@ -99,16 +99,18 @@ void Helpbox::addLine(const std::string& icon, const std::string& text, const in if (!text.empty()){ int x_text = w_picon + (picon ? OFFSET_INNER_MID : 0); CComponentsText * txt = new CComponentsText(x_text, 0, line->getWidth()-x_text, 0, text, text_mode, font); - txt->doPaintBg(false); - txt->forceTextPaint(); + if(txt){ + txt->doPaintBg(false); + txt->forceTextPaint(); #if 0 //"contrast agent", if you want to see where the text items are drawn. txt->setColorBody(COL_RED); #endif - int lines = txt->getCTextBoxObject()->getLines(); - txt_height = std::max(lines*font->getHeight(), h_line); - txt->setHeight(txt_height); + int lines = txt->getCTextBoxObject()->getLines(); + txt_height = std::max(lines*font->getHeight(), h_line); + txt->setHeight(txt_height); - line->addCCItem(txt); + line->addCCItem(txt); + } } if (txt_height > line->getHeight()) diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index 2ed9085ec..de9a1bf1b 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -58,10 +58,10 @@ #include #include -#define MAX_WINDOW_WIDTH (frameBuffer->getScreenWidth() - 40) -#define MAX_WINDOW_HEIGHT (frameBuffer->getScreenHeight() - 40) +#define MAX_WINDOW_WIDTH (frameBuffer ? frameBuffer->getScreenWidth() - 40:0) +#define MAX_WINDOW_HEIGHT (frameBuffer ? frameBuffer->getScreenHeight() - 40:0) -#define MIN_WINDOW_WIDTH (frameBuffer->getScreenWidth() >> 1) +#define MIN_WINDOW_WIDTH (frameBuffer ? frameBuffer->getScreenWidth() >> 1:0) #define MIN_WINDOW_HEIGHT 40 #define TITLE_BACKGROUND_COLOR COL_MENUHEAD_PLUS_0 @@ -206,7 +206,7 @@ void CListFrame::reSizeMainFrameWidth(int textWidth) int iNewWindowWidth = textWidth + m_cFrameScrollRel.iWidth + 2*OFFSET_INNER_MID; - if( iNewWindowWidth > m_nMaxWidth) iNewWindowWidth = m_nMaxWidth; + if(iNewWindowWidth > m_nMaxWidth) iNewWindowWidth = m_nMaxWidth; if((unsigned int) iNewWindowWidth < MIN_WINDOW_WIDTH) iNewWindowWidth = MIN_WINDOW_WIDTH; m_cFrame.iWidth = iNewWindowWidth; diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index f325cedb1..a0c789a86 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -278,12 +278,17 @@ void CStringInput::keyDownPressed() { int npos = 0; std::string tmp_value = *valueString; - for(int count=0;count<(int)strlen(validchars);count++) + const int validchar_len = (int)strlen(validchars); + for(int count=0;countat(selected)==validchars[count]) npos = count; npos--; - if(npos<0) - npos = strlen(validchars)-1; + if(npos<0){ + if(validchar_len > 0) + npos = validchar_len-1; + else + npos = 0; + } valueString->at(selected)=validchars[npos]; int current_value = atoi(*valueString); diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index 20b3f34f9..68c92c5e3 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -466,7 +466,7 @@ int CNeutrinoAPI::setVideoAspectRatioAsString(std::string newRatioString) //------------------------------------------------------------------------- std::string CNeutrinoAPI::getVideoResolutionAsString(void) { - int xres, yres, framerate; + int xres = 0, yres = 0, framerate = 0; videoDecoder->getPictureInfo(xres, yres, framerate); std::stringstream out; out << xres << "x" << yres; @@ -476,7 +476,7 @@ std::string CNeutrinoAPI::getVideoResolutionAsString(void) //------------------------------------------------------------------------- std::string CNeutrinoAPI::getVideoFramerateAsString(void) { - int xres, yres, framerate; + int xres = 0, yres = 0, framerate = 0; std::string sframerate = "{=L:unknown=}"; videoDecoder->getPictureInfo(xres, yres, framerate); switch(framerate){ @@ -491,7 +491,7 @@ std::string CNeutrinoAPI::getVideoFramerateAsString(void) //------------------------------------------------------------------------- std::string CNeutrinoAPI::getAudioInfoAsString(void) { - int type, layer, freq, mode, lbitrate; + int type = 0, layer = 0, freq = 0, mode = 0, lbitrate = 0; audioDecoder->getAudioInfo(type, layer, freq, lbitrate, mode); std::stringstream out; if(type == 0) @@ -557,7 +557,7 @@ void CNeutrinoAPI::SendAllTimers(std::string url, bool force) Timerd->getTimerList(timerlist); sort(timerlist.begin(), timerlist.end()); - int pre,post; + int pre = 0,post = 0; Timerd->getRecordingSafety(pre,post); CHTTPTool httpTool; std::string r_url; diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 4b8f8ce7d..e5b2178c7 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -1023,6 +1023,10 @@ std::string CNeutrinoYParser::func_set_timer_form(CyhookHandler *hh, std::strin unsigned timerId=0; std::string cmd, stimerid; CTimerd::responseGetTimer timer; // Timer + timer.alarmTime = 0; + timer.stopTime = 0; + timer.apids = 0; + timer.eventType = CTimerd::__TIMER_NEXTPROGRAM;//nothing time_t now_t = time(NULL); ySplitString(para, " ", cmd, stimerid); if(cmd != "new") diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index 620c0b9b6..10e582aa7 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -626,6 +626,7 @@ uint32_t CFrontend::getRate() const fe_status_t CFrontend::getStatus(void) const { struct dvb_frontend_event event; + event.status = FE_REINIT; fop(ioctl, FE_READ_STATUS, &event.status); return (fe_status_t) (event.status & FE_HAS_LOCK); }