# HG changeset patch # User michael # Date 1196657341 0 # Node ID f417ee08f8c1328c13fac1740eef672b12c65dfe # Parent b556182542cb276b6f72de5cf95b74428280b2ad prevent O(n^2) execution of ff_mpa_decode_header() for valid mp3 files diff -r b556182542cb -r f417ee08f8c1 mp3.c --- 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;