Mercurial > libavformat.hg
changeset 3355:fa366fc51861 libavformat
return error if frame_offset is negative, prevent segfault
author | bcoudurier |
---|---|
date | Mon, 26 May 2008 03:53:48 +0000 |
parents | 5be8d622e458 |
children | 7e144933facd |
files | ffmdec.c |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ffmdec.c Mon May 26 03:53:10 2008 +0000 +++ b/ffmdec.c Mon May 26 03:53:48 2008 +0000 @@ -104,7 +104,7 @@ frame_offset = get_be16(pb); get_buffer(pb, ffm->packet, ffm->packet_size - FFM_HEADER_SIZE); ffm->packet_end = ffm->packet + (ffm->packet_size - FFM_HEADER_SIZE - fill_size); - if (ffm->packet_end < ffm->packet) + if (ffm->packet_end < ffm->packet || frame_offset < 0) return -1; /* if first packet or resynchronization packet, we must handle it specifically */