aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-03 07:43:32 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-03 18:35:46 +0100
commite732d0f60872bf273eb56ef17b23a543fd74479f (patch)
treedc1ade5dfc7e3adfd9819094fcbef9a8788a1533 /libavformat
parentc6810d98a54a45b242dcec47867180da53162de8 (diff)
downloadffmpeg-e732d0f60872bf273eb56ef17b23a543fd74479f.tar.gz
mpeg-ts: fix handling of size=0 SL headers.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mpegts.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 81649c7cb6..3d825fe193 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -710,6 +710,12 @@ static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf
int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
int dts_flag = -1, cts_flag = -1;
int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
+
+ if (buf_size<=0) {
+ av_log(0,AV_LOG_WARNING, "empty SL header\n");
+ return 0;
+ }
+
init_get_bits(&gb, buf, buf_size*8);
if (sl->use_au_start)