From e2796948b2abadbb60fca25af2922737c253805a Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 3 Dec 2012 09:34:12 +0100 Subject: [PATCH] Fixed calling iconv_close() only with a valid iconv_t value --- CONTRIBUTORS | 1 + HISTORY | 3 ++- tools.c | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index a993e76b..75f3c097 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2835,6 +2835,7 @@ Juergen Lock for fixing cUnbufferedFile::Seek() in case it is compiled without USE_FADVISE for reporting a problem with EPG scan on systems with only a single DVB device that use software output + for fixing calling iconv_close() only with a valid iconv_t value Sergiu Dotenco for reporting a missing initialization in sDvbSpuRect diff --git a/HISTORY b/HISTORY index 68b41cf0..9bbabaf3 100644 --- a/HISTORY +++ b/HISTORY @@ -7339,7 +7339,7 @@ Video Disk Recorder Revision History - Modified editing marks are now written to disk whenever the replay progress display gets hidden (thanks to Christoph Haubrich). -2012-12-02: Version 1.7.33 +2012-12-03: Version 1.7.33 - In order to be able to play TS recordings from other sources, in which there is more than one PMT PID in the PAT, 'int cPatPmtParser::PatPmt(void)' has been changed @@ -7358,3 +7358,4 @@ Video Disk Recorder Revision History - Fixed a typo in skins.h (thanks to Lars Hanisch). - Simplified calculating the PTS offset in cPtsFixer::Fix() and fixed the overflow handling of PCR values (thanks to Sören Moch). +- Fixed calling iconv_close() only with a valid iconv_t value (thanks to Juergen Lock). diff --git a/tools.c b/tools.c index 26c325b6..efb9f164 100644 --- a/tools.c +++ b/tools.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.c 2.26 2012/09/30 13:04:14 kls Exp $ + * $Id: tools.c 2.27 2012/12/03 09:31:32 kls Exp $ */ #include "tools.h" @@ -842,7 +842,8 @@ cCharSetConv::cCharSetConv(const char *FromCode, const char *ToCode) cCharSetConv::~cCharSetConv() { free(result); - iconv_close(cd); + if (cd != (iconv_t)-1) + iconv_close(cd); } void cCharSetConv::SetSystemCharacterTable(const char *CharacterTable)