Skip to content

Commit e5d2df6

Browse files
committed
big PES packets are assigned zero length to escape overflow
1 parent 0a8f0ee commit e5d2df6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hls/ngx_rtmp_mpegts.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ ngx_rtmp_mpegts_write_frame(ngx_file_t *file, ngx_rtmp_mpegts_frame_t *f,
176176
}
177177

178178
pes_size = (b->last - b->pos) + header_size + 3;
179+
if (pes_size > 0xffff) {
180+
pes_size = 0;
181+
}
179182

180183
*p++ = (pes_size >> 8);
181184
*p++ = pes_size;

0 commit comments

Comments
 (0)