Commit 1a14e391 authored by Aman Gupta's avatar Aman Gupta

avformat/mpegts: use MAX_SECTION_SIZE instead of hardcoded value

Signed-off-by: 's avatarAman Gupta <aman@tmm1.net>
parent 2c500f50
...@@ -401,7 +401,7 @@ static void write_section_data(MpegTSContext *ts, MpegTSFilter *tss1, ...@@ -401,7 +401,7 @@ static void write_section_data(MpegTSContext *ts, MpegTSFilter *tss1,
} else { } else {
if (tss->end_of_section_reached) if (tss->end_of_section_reached)
return; return;
len = 4096 - tss->section_index; len = MAX_SECTION_SIZE - tss->section_index;
if (buf_size < len) if (buf_size < len)
len = buf_size; len = buf_size;
memcpy(tss->section_buf + tss->section_index, buf, len); memcpy(tss->section_buf + tss->section_index, buf, len);
...@@ -411,7 +411,7 @@ static void write_section_data(MpegTSContext *ts, MpegTSFilter *tss1, ...@@ -411,7 +411,7 @@ static void write_section_data(MpegTSContext *ts, MpegTSFilter *tss1,
/* compute section length if possible */ /* compute section length if possible */
if (tss->section_h_size == -1 && tss->section_index >= 3) { if (tss->section_h_size == -1 && tss->section_index >= 3) {
len = (AV_RB16(tss->section_buf + 1) & 0xfff) + 3; len = (AV_RB16(tss->section_buf + 1) & 0xfff) + 3;
if (len > 4096) if (len > MAX_SECTION_SIZE)
return; return;
tss->section_h_size = len; tss->section_h_size = len;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment