Mercurial > libavformat.hg
changeset 4964:35d7a76514f2 libavformat
check that len is not negative
author | bcoudurier |
---|---|
date | Wed, 27 May 2009 00:46:20 +0000 |
parents | 0c34f80265ac |
children | ca59375d99f8 |
files | mpegts.c |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mpegts.c Wed May 27 00:44:00 2009 +0000 +++ b/mpegts.c Wed May 27 00:46:20 2009 +0000 @@ -892,6 +892,8 @@ /* PES packing parsing */ case MPEGTS_PESHEADER_FILL: len = pes->pes_header_size - pes->data_index; + if (len < 0) + return if (len > buf_size) len = buf_size; memcpy(pes->header + pes->data_index, p, len);