Fixed handling reallocated memory in cCharSetConv::Convert()

This commit is contained in:
Klaus Schmidinger 2007-10-13 12:03:39 +02:00
parent 441b002be9
commit 929d3e9ba2
3 changed files with 5 additions and 2 deletions

View File

@ -1529,6 +1529,7 @@ Udo Richter <udo_richter@gmx.de>
for fixing handling single byte characters >0x7F in Utf8ToArray()
for fixing clearing color buttons in the 'curses' skin
for adding a missing error report to cCuttingThread::Action()
for reporting a problem in handling reallocated memory in cCharSetConv::Convert()
Sven Kreiensen <svenk@kammer.uni-hannover.de>
for his help in keeping 'channels.conf.terr' up to date

View File

@ -5460,3 +5460,5 @@ Video Disk Recorder Revision History
- Only creating a new cDvbOsdProvider in cDvbDevice::MakePrimaryDevice() if 'On'
is true (i.e. this device is being made the primary device).
- Updated the Italian OSD texts (thanks to Diego Pierotto).
- Fixed handling reallocated memory in cCharSetConv::Convert() (reported by Udo
Richter).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: tools.c 1.135 2007/08/05 12:18:15 kls Exp $
* $Id: tools.c 1.136 2007/10/13 12:00:21 kls Exp $
*/
#include "tools.h"
@ -791,7 +791,7 @@ const char *cCharSetConv::Convert(const char *From, char *To, size_t ToLength)
size_t d = ToPtr - result;
size_t r = length / 2;
length += r;
result = (char *)realloc(result, length);
Converted = result = (char *)realloc(result, length);
ToLength += r;
ToPtr = result + d;
}