1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed a memory leak in case of broken Extended Event Descriptors

This commit is contained in:
Klaus Schmidinger 2015-02-01 14:59:52 +01:00
parent 1c4865147a
commit 471b287f70
6 changed files with 21 additions and 14 deletions

View File

@ -2909,6 +2909,7 @@ Lars Hanisch <dvb@flensrocker.de>
for fixing learning keyboard remote control codes for fixing learning keyboard remote control codes
for making VDR read command line options from *.conf files in /etc/vdr/conf.d for making VDR read command line options from *.conf files in /etc/vdr/conf.d
for adding a missing backslash to the help text of the SVDRP command MOVR for adding a missing backslash to the help text of the SVDRP command MOVR
for fixing a memory leak in case of broken Extended Event Descriptors
Alex Lasnier <alex@fepg.org> Alex Lasnier <alex@fepg.org>
for adding tuning support for ATSC devices for adding tuning support for ATSC devices

View File

@ -8452,3 +8452,8 @@ Video Disk Recorder Revision History
- The function cDvbPlayer::Goto() now automatically calls Play() if Still is false. - The function cDvbPlayer::Goto() now automatically calls Play() if Still is false.
- Added support for LCN (Logical Channel Numbers), which plugins may use to sort - Added support for LCN (Logical Channel Numbers), which plugins may use to sort
channels (thanks to Rolf Ahrenberg). channels (thanks to Rolf Ahrenberg).
2015-02-01: Version 2.1.9
- Fixed a memory leak in case of broken Extended Event Descriptors (thanks to Lars
Hanisch).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: config.h 3.13 2015/01/27 10:50:11 kls Exp $ * $Id: config.h 3.14 2015/02/01 14:59:52 kls Exp $
*/ */
#ifndef __CONFIG_H #ifndef __CONFIG_H
@ -22,13 +22,13 @@
// VDR's own version number: // VDR's own version number:
#define VDRVERSION "2.1.8" #define VDRVERSION "2.1.9"
#define VDRVERSNUM 20108 // Version * 10000 + Major * 100 + Minor #define VDRVERSNUM 20109 // Version * 10000 + Major * 100 + Minor
// The plugin API's version number: // The plugin API's version number:
#define APIVERSION "2.1.8" #define APIVERSION "2.1.9"
#define APIVERSNUM 20108 // Version * 10000 + Major * 100 + Minor #define APIVERSNUM 20109 // Version * 10000 + Major * 100 + Minor
// When loading plugins, VDR searches them by their APIVERSION, which // When loading plugins, VDR searches them by their APIVERSION, which
// may be smaller than VDRVERSION in case there have been no changes to // may be smaller than VDRVERSION in case there have been no changes to

4
eit.c
View File

@ -8,7 +8,7 @@
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
* Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>. * Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>.
* *
* $Id: eit.c 3.5 2014/02/08 14:20:27 kls Exp $ * $Id: eit.c 3.6 2015/02/01 14:55:27 kls Exp $
*/ */
#include "eit.h" #include "eit.h"
@ -136,7 +136,7 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo
UseExtendedEventDescriptor = true; UseExtendedEventDescriptor = true;
} }
if (UseExtendedEventDescriptor) { if (UseExtendedEventDescriptor) {
ExtendedEventDescriptors->Add(eed); if (ExtendedEventDescriptors->Add(eed))
d = NULL; // so that it is not deleted d = NULL; // so that it is not deleted
} }
if (eed->getDescriptorNumber() == eed->getLastDescriptorNumber()) if (eed->getDescriptorNumber() == eed->getLastDescriptorNumber())

View File

@ -6,7 +6,7 @@
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* $Id: si.c 3.1 2013/10/30 10:16:18 kls Exp $ * $Id: si.c 3.2 2015/02/01 14:55:27 kls Exp $
* * * *
***************************************************************************/ ***************************************************************************/
@ -198,17 +198,18 @@ void DescriptorGroup::Delete() {
} }
} }
void DescriptorGroup::Add(GroupDescriptor *d) { bool DescriptorGroup::Add(GroupDescriptor *d) {
if (!array) { if (!array) {
length=d->getLastDescriptorNumber()+1; length=d->getLastDescriptorNumber()+1;
array=new GroupDescriptor*[length]; //numbering is zero-based array=new GroupDescriptor*[length]; //numbering is zero-based
for (int i=0;i<length;i++) for (int i=0;i<length;i++)
array[i]=0; array[i]=0;
} else if (length != d->getLastDescriptorNumber()+1) } else if (length != d->getLastDescriptorNumber()+1)
return; //avoid crash in case of misuse return false; //avoid crash in case of misuse
if (length <= d->getDescriptorNumber()) if (length <= d->getDescriptorNumber())
return; // see http://www.vdr-portal.de/board60-linux/board14-betriebssystem/board69-c-t-vdr/p1025777-segfault-mit-vdr-1-7-21/#post1025777 return false; // see http://www.vdr-portal.de/board60-linux/board14-betriebssystem/board69-c-t-vdr/p1025777-segfault-mit-vdr-1-7-21/#post1025777
array[d->getDescriptorNumber()]=d; array[d->getDescriptorNumber()]=d;
return true;
} }
bool DescriptorGroup::isComplete() { bool DescriptorGroup::isComplete() {

View File

@ -6,7 +6,7 @@
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* $Id: si.h 3.2 2014/02/08 14:11:32 kls Exp $ * $Id: si.h 3.3 2015/02/01 14:55:27 kls Exp $
* * * *
***************************************************************************/ ***************************************************************************/
@ -483,7 +483,7 @@ class DescriptorGroup {
public: public:
DescriptorGroup(bool deleteOnDesctruction=true); DescriptorGroup(bool deleteOnDesctruction=true);
~DescriptorGroup(); ~DescriptorGroup();
void Add(GroupDescriptor *d); bool Add(GroupDescriptor *d);
void Delete(); void Delete();
int getLength() { return length; } int getLength() { return length; }
GroupDescriptor **getDescriptors() { return array; } GroupDescriptor **getDescriptors() { return array; }