summaryrefslogtreecommitdiff
path: root/remux.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-11-16 16:57:43 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-11-16 16:57:43 +0100
commit1d8676e85f1f1df9883e273962d753cff5232f1e (patch)
tree52bda7e33cd1c03a03566dfd1e616a3f12c4a04c /remux.c
parentac8e03a89cb86e2f68924533d53a3c93f7c972c9 (diff)
downloadvdr-1d8676e85f1f1df9883e273962d753cff5232f1e.tar.gz
vdr-1d8676e85f1f1df9883e273962d753cff5232f1e.tar.bz2
Fixed cRemux::ScanVideoPacket() to make sure it doesn't access memory beyond the end of the given buffer
Diffstat (limited to 'remux.c')
-rw-r--r--remux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/remux.c b/remux.c
index e096f9cc..b9c04af3 100644
--- a/remux.c
+++ b/remux.c
@@ -8,7 +8,7 @@
* the Linux DVB driver's 'tuxplayer' example and were rewritten to suit
* VDR's needs.
*
- * $Id: remux.c 1.21 2004/10/24 09:25:33 kls Exp $
+ * $Id: remux.c 1.22 2004/11/16 16:49:03 kls Exp $
*/
#include "remux.h"
@@ -451,7 +451,7 @@ int cRemux::ScanVideoPacket(const uchar *Data, int Count, int Offset, uchar &Pic
if (Length >= 8) {
int i = Offset + 8; // the minimum length of the video packet header
i += Data[i] + 1; // possible additional header bytes
- for (; i < Offset + Length; i++) {
+ for (; i < Offset + Length - 5; i++) {
if (Data[i] == 0 && Data[i + 1] == 0 && Data[i + 2] == 1) {
switch (Data[i + 3]) {
case SC_PICTURE: PictureType = (Data[i + 5] >> 3) & 0x07;