Browse Source

Fix off-by-one in ts_packet_get_payload_offset().

Georgi Chorbadzhiyski 8 years ago
parent
commit
daa76d8d2d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tsfuncs.c

+ 1 - 1
tsfuncs.c View File

@@ -49,7 +49,7 @@ uint8_t ts_packet_get_payload_offset(uint8_t *ts_packet) {
49 49
 			return 0;
50 50
 		if (!payload_field && adapt_len > 183)
51 51
 			return 0;
52
-		if (adapt_len + 1 + 4 >= 188) // adaptation field takes the whole packet
52
+		if (adapt_len + 4 > 188) // adaptation field takes the whole packet
53 53
 			return 0;
54 54
 		return 4 + 1 + adapt_len; // ts header + adapt_field_len_byte + adapt_field_len
55 55
 	} else {