From b9bfba20f25a0562d22bb57d611abc3918e1c147 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 19 Feb 2006 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.3.43=20-=20Removed=20an=20unnecessary=20toF?= =?UTF-8?q?ile->SetReadAhead()=20from=20cutter.c=20(thanks=20to=20Artur=20?= =?UTF-8?q?=20=20Skawina).=20-=20The=20"Back"=20key=20now=20restores=20the?= =?UTF-8?q?=20original=20string=20when=20pressed=20while=20editing=20a=20?= =?UTF-8?q?=20=20string=20item=20(suggested=20by=20Markus=20Hahn).=20-=20N?= =?UTF-8?q?ow=20stopping=20scanning=20the=20video=20directory=20if=20there?= =?UTF-8?q?=20are=20too=20many=20levels=20of=20=20=20symbolic=20links,=20w?= =?UTF-8?q?hich=20might=20indicate=20a=20recursive=20link=20loop=20(based?= =?UTF-8?q?=20on=20a=20patch=20=20=20from=20Helmut=20Auer).=20-=20Improved?= =?UTF-8?q?=20OSD=20area=20handling=20in=20cDvbSpuDecoder=20(thanks=20to?= =?UTF-8?q?=20Marco=20Schl=C3=BC=C3=9Fler).=20-=20Now=20logging=20the=20de?= =?UTF-8?q?scription=20(if=20present)=20in=20case=20a=20thread=20is=20canc?= =?UTF-8?q?eled=20(suggested=20=20=20by=20Marco=20Schl=C3=BC=C3=9Fler).=20?= =?UTF-8?q?-=20cMenuText=20now=20uses=20the=20given=20font=20(thanks=20to?= =?UTF-8?q?=20Rolf=20Ahrenberg).=20-=20The=20ST:TNG=20skin=20now=20uses=20?= =?UTF-8?q?the=20fixed=20font=20if=20requested=20when=20displaying=20texts?= =?UTF-8?q?.=20-=20Fixed=20some=20typos=20in=20the=20CONTRIBUTORS=20file?= =?UTF-8?q?=20(thanks=20to=20Frank=20Kr=C3=B6mmelbein).=20-=20Changed=20of?= =?UTF-8?q?fset=20and=20size=20handling=20in=20'libsi'=20from=20'unsigned'?= =?UTF-8?q?=20to=20'signed',=20so=20that=20=20=20overflows=20can=20be=20be?= =?UTF-8?q?tter=20detected=20(thanks=20to=20Marcel=20Wiesweg).=20-=20Check?= =?UTF-8?q?ing=20data=20size=20in=20CaDescriptor::Parse()=20and=20LinkageD?= =?UTF-8?q?escriptor::Parse()=20of=20=20=20'libsi'=20to=20avoid=20crashes?= =?UTF-8?q?=20with=20invalid=20data=20(thanks=20to=20Marcel=20Wiesweg).=20?= =?UTF-8?q?-=20Made=20CharArray::DataOwnData::assign()=20in=20'libsi'=20mo?= =?UTF-8?q?re=20robust=20against=20invalid=20=20=20data=20(suggested=20by?= =?UTF-8?q?=20Oliver=20Endriss).=20Also=20changed=20CharArray::DataOwnData?= =?UTF-8?q?::Delete()=20=20=20so=20that=20it=20sets=20'size'=20and=20'data?= =?UTF-8?q?'=20to=200.=20-=20Now=20resetting=20the=20channel=20number=20if?= =?UTF-8?q?=20the=20number=20entered=20through=20the=20numeric=20keys=20?= =?UTF-8?q?=20=20exceeds=20the=20maximum=20channel=20number=20(thanks=20to?= =?UTF-8?q?=20Rolf=20Ahrenberg).=20-=20The=20language=20code=20in=20the=20?= =?UTF-8?q?'X'=20component=20records=20of=20EPG=20data=20can=20now=20consi?= =?UTF-8?q?st=20of=20=20=20two=20codes,=20separated=20by=20'+'.=20-=20If?= =?UTF-8?q?=20a=20recording=20starts=20and=20there=20is=20no=20EPG=20data?= =?UTF-8?q?=20available=20for=20the=20recorded=20channel,=20=20=20the=20'X?= =?UTF-8?q?'=20audio=20component=20records=20for=20the=20'info.vdr'=20file?= =?UTF-8?q?=20are=20now=20generated=20from=20the=20=20=20channel's=20PID?= =?UTF-8?q?=20data.=20-=20Externally=20provided=20EPG=20data=20(with=20tab?= =?UTF-8?q?le=20ID=200x00)=20now=20gets=20its=20component=20=20=20descript?= =?UTF-8?q?ors=20set=20from=20the=20broadcast=20data,=20so=20that=20langua?= =?UTF-8?q?ge=20codes=20and=20descriptions=20=20=20are=20available=20(sugg?= =?UTF-8?q?ested=20by=20Andreas=20Brugger).=20-=20When=20setting=20the=20a?= =?UTF-8?q?udio=20track=20descriptions,=20the=20language=20codes=20are=20n?= =?UTF-8?q?ow=20also=20set=20=20=20in=20case=20this=20is=20a=20replay=20se?= =?UTF-8?q?ssion=20(based=20on=20a=20patch=20from=20Rolf=20Ahrenberg).=20-?= =?UTF-8?q?=20If=20a=20recording=20starts=20and=20the=20channel's=20audio?= =?UTF-8?q?=20PID=20data=20has=20more=20language=20code=20=20=20informatio?= =?UTF-8?q?n=20than=20the=20EPG's=20component=20data,=20the=20code=20from?= =?UTF-8?q?=20the=20channel=20is=20taken.=20-=20Fixed=20handling=20DPID=20?= =?UTF-8?q?when=20deciding=20whether=20to=20switch=20to=20'Transfer=20Mode?= =?UTF-8?q?'=20(thanks=20=20=20to=20Marco=20Schl=C3=BC=C3=9Fler).=20-=20Fi?= =?UTF-8?q?xed=20replaying=20recordings=20of=20radio=20channels=20with=20m?= =?UTF-8?q?any=20audio=20tracks=20(thanks=20to=20=20=20Reinhard=20Nissl).?= =?UTF-8?q?=20-=20Added=20a=20comment=20to=20tChannelID::nid,=20explaining?= =?UTF-8?q?=20that=20is=20is=20actually=20the=20"original"=20=20=20network?= =?UTF-8?q?=20id.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libsi/util.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'libsi/util.c') diff --git a/libsi/util.c b/libsi/util.c index 3465794..b0db93e 100644 --- a/libsi/util.c +++ b/libsi/util.c @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: util.c 1.5 2005/05/28 14:15:29 kls Exp $ + * $Id: util.c 1.7 2006/02/18 11:17:50 kls Exp $ * * ***************************************************************************/ @@ -47,7 +47,7 @@ CharArray& CharArray::operator=(const CharArray &f) { return *this; } -void CharArray::assign(const unsigned char*data, unsigned int size, bool doCopy) { +void CharArray::assign(const unsigned char*data, int size, bool doCopy) { //immutable if (!data_) data_= doCopy ? (Data*)new DataOwnData() : (Data*)new DataForeignData(); @@ -76,13 +76,13 @@ bool CharArray::operator==(const CharArray &other) const { return false; //do _not_ use strcmp! Data is not necessarily null-terminated. - for (unsigned int i=0;isize;i++) + for (int i=0;isize;i++) if (data_->data[i] != other.data_->data[i]) return false; return true; } -CharArray CharArray::operator+(const unsigned int offset) const { +CharArray CharArray::operator+(const int offset) const { CharArray f(*this); f.off+=offset; return f; @@ -117,8 +117,10 @@ CharArray::DataOwnData::~DataOwnData() { Delete(); } -void CharArray::DataOwnData::assign(const unsigned char*d, unsigned int s) { +void CharArray::DataOwnData::assign(const unsigned char*d, int s) { Delete(); + if (!d || s > 100000 || s <= 0) // ultimate plausibility check + return; size=s; unsigned char *newdata=new unsigned char[size]; memcpy(newdata, d, size); @@ -127,13 +129,15 @@ void CharArray::DataOwnData::assign(const unsigned char*d, unsigned int s) { void CharArray::DataOwnData::Delete() { delete[] data; + size=0; + data=0; } CharArray::DataForeignData::~DataForeignData() { Delete(); } -void CharArray::DataForeignData::assign(const unsigned char*d, unsigned int s) { +void CharArray::DataForeignData::assign(const unsigned char*d, int s) { size=s; data=d; } @@ -143,7 +147,7 @@ void CharArray::DataForeignData::Delete() { } /* -void CharArray::Data::assign(unsigned int s) { +void CharArray::Data::assign(int s) { if (data) delete[] data; size=s; -- cgit v1.2.3