summaryrefslogtreecommitdiff
path: root/remux.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2011-02-20 17:37:24 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2011-02-20 17:37:24 +0100
commit82a13c7a0ec7f709335c603f94e4498e4e5fc637 (patch)
tree1fa6b7f1edbef0adeefcada40df3976979320362 /remux.c
parente85852672fdc218356e8a8565ba42ed85bed5fb4 (diff)
downloadvdr-82a13c7a0ec7f709335c603f94e4498e4e5fc637.tar.gz
vdr-82a13c7a0ec7f709335c603f94e4498e4e5fc637.tar.bz2
Fixed reallocating memory in cTsToPes::PutTs()
Diffstat (limited to 'remux.c')
-rw-r--r--remux.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/remux.c b/remux.c
index b30b12ca..fd47d3c3 100644
--- a/remux.c
+++ b/remux.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: remux.c 2.48 2010/11/01 12:29:17 kls Exp $
+ * $Id: remux.c 2.49 2011/02/20 17:27:47 kls Exp $
*/
#include "remux.h"
@@ -666,9 +666,12 @@ void cTsToPes::PutTs(const uchar *Data, int Length)
return; // skip everything before the first payload start
Length = TsGetPayload(&Data);
if (length + Length > size) {
- size = max(KILOBYTE(2), length + Length);
- data = (uchar *)realloc(data, size);
- if (!data) {
+ int NewSize = max(KILOBYTE(2), length + Length);
+ if (uchar *NewData = (uchar *)realloc(data, NewSize)) {
+ data = NewData;
+ size = NewSize;
+ }
+ else {
Reset();
return;
}