Browse Source

Prevent 1 byte overwrite at the end of section

Georgi Chorbadzhiyski 13 years ago
parent
commit
93e053fc63
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      tsfuncs_section_data.c

+ 1
- 1
tsfuncs_section_data.c View File

@@ -107,7 +107,7 @@ void ts_section_add_packet(struct ts_section_header *sec, struct ts_header *ts_h
107 107
 		return;
108 108
 
109 109
 	if (sec->section_pos + to_copy >= 4092) {
110
-		to_copy = (sec->section_length + 4) - sec->section_pos;
110
+		to_copy = (sec->section_length + 3) - sec->section_pos;
111 111
 	}
112 112
 
113 113
 	memcpy(sec->section_data + sec->section_pos, ts_packet + payload_offset, to_copy);

Loading…
Cancel
Save