diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-11-07 20:29:18 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-11-07 20:29:18 +0000 |
| commit | 8c0683ea5313544bf03af234c0a863f0b1045514 (patch) | |
| tree | fd5230f81dd37fbe266ed85dc0ab89f24aca674e | |
| parent | 9f51417be9d86ef8f21116d2ecd15e536f67783c (diff) | |
| download | enigma2-8c0683ea5313544bf03af234c0a863f0b1045514.tar.gz enigma2-8c0683ea5313544bf03af234c0a863f0b1045514.zip | |
fix crashes in cable scan
| -rw-r--r-- | lib/dvb/esection.h | 17 | ||||
| -rw-r--r-- | lib/dvb/scan.cpp | 6 |
2 files changed, 18 insertions, 5 deletions
diff --git a/lib/dvb/esection.h b/lib/dvb/esection.h index 6c1683fe..6845bfa3 100644 --- a/lib/dvb/esection.h +++ b/lib/dvb/esection.h @@ -40,10 +40,17 @@ private: protected: int createTable(int nr, const __u8 *data, unsigned int max) { + int ssize = sections.size(); + if (max < ssize || nr >= max) + { + eDebug("kaputt max(%d) < ssize(%d) || nr(%d) >= max(%d)", + max, ssize, nr, max); + return 0; + } if (avail.find(nr) != avail.end()) delete sections[nr]; + sections.resize(max); - sections[nr] = new Section(data); avail.insert(nr); @@ -53,11 +60,11 @@ protected: else printf("-"); - printf(" %d/%d TID %02x\n", avail.size(), max, data[0]); + eDebug(" %d/%d TID %02x", avail.size(), max, data[0]); if (avail.size() == max) { - printf("done!\n"); + eDebug("done!"); return 1; } else return 0; @@ -69,8 +76,8 @@ public: } ~eTable() { - for (typename std::vector<Section*>::iterator i(sections.begin()); i != sections.end(); ++i) - delete *i; + for (std::set<int>::iterator i(avail.begin()); i != avail.end(); ++i) + delete sections[*i]; } }; diff --git a/lib/dvb/scan.cpp b/lib/dvb/scan.cpp index 70c3e6b3..8b895dc9 100644 --- a/lib/dvb/scan.cpp +++ b/lib/dvb/scan.cpp @@ -305,6 +305,12 @@ void eDVBScan::addChannelToScan(const eDVBChannelID &chid, iDVBFrontendParameter ++i; } + if (found_count > 0) + { + eDebug("already in todo list"); + return; + } + /* ... in the list of successfully scanned channels */ for (std::list<ePtr<iDVBFrontendParameters> >::const_iterator i(m_ch_scanned.begin()); i != m_ch_scanned.end(); ++i) if (sameChannel(*i, feparm)) |
