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

Fixed a possible memory corruption in cTsToPes::GetPes()

This commit is contained in:
Klaus Schmidinger 2012-01-12 12:25:54 +01:00
parent 44da06f384
commit 70d4e5105b
2 changed files with 7 additions and 1 deletions

View File

@ -6814,3 +6814,5 @@ Video Disk Recorder Revision History
with version 5.3 or higher that can handle the DTV_DVBT2_PLP_ID call (thanks with version 5.3 or higher that can handle the DTV_DVBT2_PLP_ID call (thanks
to Rolf Ahrenberg). to Rolf Ahrenberg).
- Fixed cConfig::Load() for g++ version 4.7.0 (thanks to Ville Skyttä). - Fixed cConfig::Load() for g++ version 4.7.0 (thanks to Ville Skyttä).
- Fixed a possible memory corruption in cTsToPes::GetPes() in case of broken
TS packets, e.g. when switching channels.

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: remux.c 2.62 2011/09/04 13:09:06 kls Exp $ * $Id: remux.c 2.63 2012/01/12 12:07:58 kls Exp $
*/ */
#include "remux.h" #include "remux.h"
@ -701,6 +701,10 @@ const uchar *cTsToPes::GetPes(int &Length)
uchar *p = data + offset - 6; uchar *p = data + offset - 6;
if (p != data) { if (p != data) {
p -= 3; p -= 3;
if (p < data) {
Reset();
return NULL;
}
memmove(p, data, 4); memmove(p, data, 4);
} }
int l = min(length - offset, MAXPESLENGTH); int l = min(length - offset, MAXPESLENGTH);