diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-12-03 04:49:01 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-12-03 04:49:01 +0000 |
commit | 5110d151b6b2b835ebcdbe44f7a445b6c23eca62 (patch) | |
tree | af053d8a07f9d759a872c5c480078831820f4c96 /libavformat/mp3.c | |
parent | e5152216184d5648aed414a380c3d522df92bfad (diff) | |
download | ffmpeg-5110d151b6b2b835ebcdbe44f7a445b6c23eca62.tar.gz |
prevent O(n^2) execution of ff_mpa_decode_header() for valid mp3 files
Originally committed as revision 11144 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mp3.c')
-rw-r--r-- | libavformat/mp3.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mp3.c b/libavformat/mp3.c index 4ad9b67d5b..74bd275077 100644 --- a/libavformat/mp3.c +++ b/libavformat/mp3.c @@ -418,6 +418,8 @@ static int mp3_read_probe(AVProbeData *p) 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; |