Mercurial > libavformat.hg
changeset 2795:f417ee08f8c1 libavformat
prevent O(n^2) execution of ff_mpa_decode_header() for valid mp3 files
author | michael |
---|---|
date | Mon, 03 Dec 2007 04:49:01 +0000 |
parents | b556182542cb |
children | 5002462418f7 |
files | mp3.c |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mp3.c Sun Dec 02 23:27:01 2007 +0000 +++ b/mp3.c Mon Dec 03 04:49:01 2007 +0000 @@ -418,6 +418,8 @@ max_frames = FFMAX(max_frames, frames); if(buf == p->buf) first_frames= frames; + if(buf2 > end) + break; } if (first_frames>=3) return AVPROBE_SCORE_MAX/2+1; else if(max_frames>=3) return AVPROBE_SCORE_MAX/4;