Skip to content
Snippets Groups Projects
Commit 5110d151 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

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
parent e5152216
No related branches found
No related tags found
No related merge requests found
...@@ -418,6 +418,8 @@ static int mp3_read_probe(AVProbeData *p) ...@@ -418,6 +418,8 @@ static int mp3_read_probe(AVProbeData *p)
max_frames = FFMAX(max_frames, frames); max_frames = FFMAX(max_frames, frames);
if(buf == p->buf) if(buf == p->buf)
first_frames= frames; first_frames= frames;
if(buf2 > end)
break;
} }
if (first_frames>=3) return AVPROBE_SCORE_MAX/2+1; if (first_frames>=3) return AVPROBE_SCORE_MAX/2+1;
else if(max_frames>=3) return AVPROBE_SCORE_MAX/4; else if(max_frames>=3) return AVPROBE_SCORE_MAX/4;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment