diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-12-03 08:27:04 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-12-03 08:27:04 +0000 |
commit | 5ef5501b71c3046302494d1f1fa45e9af3ea7a7a (patch) | |
tree | ebeb6d8a0fa6c8a5abd403a55e2b2b482af46eb0 /libavformat/mp3.c | |
parent | fda767bb4ffb2a3daa5f0f6daffc41ac99c38703 (diff) | |
download | ffmpeg-streaming-5ef5501b71c3046302494d1f1fa45e9af3ea7a7a.zip ffmpeg-streaming-5ef5501b71c3046302494d1f1fa45e9af3ea7a7a.tar.gz |
ensure that the probe code runs in O(n)
Originally committed as revision 11147 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mp3.c')
-rw-r--r-- | libavformat/mp3.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libavformat/mp3.c b/libavformat/mp3.c index 39cb60d..f99f520 100644 --- a/libavformat/mp3.c +++ b/libavformat/mp3.c @@ -405,7 +405,7 @@ static int mp3_read_probe(AVProbeData *p) buf = p->buf; end = buf + p->buf_size - sizeof(uint32_t); - for(; buf < end; buf++) { + for(; buf < end; buf= buf2+1) { buf2 = buf; for(frames = 0; buf2 < end; frames++) { @@ -418,8 +418,6 @@ 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; |