We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b4bdae commit a7d2800Copy full SHA for a7d2800
src/tsdemux.c
@@ -821,6 +821,7 @@ TSDCode tsd_parse_pes(TSDemuxContext *ctx,
821
ptr++;
822
pes->header_data_length = *ptr;
823
824
+ const uint8_t *header_end = &ptr[pes->header_data_length];
825
if(pes->flags & TSD_PPF_PTS_FLAG) {
826
uint64_t pts1 = (uint64_t) (((*ptr) >> 1) & 0x07);
827
uint64_t pts2 = (uint64_t) ((parse_u16(ptr+1) >> 1) & 0x7FFF);
@@ -952,7 +953,7 @@ TSDCode tsd_parse_pes(TSDemuxContext *ctx,
952
953
}
954
955
// get past any stuffing
- while(*ptr == 0xFF) {
956
+ while(ptr < header_end && *ptr == 0xFF) {
957
958
959
pes->data_bytes = ptr;
0 commit comments