# HG changeset patch # User michael # Date 1196670424 0 # Node ID 428c1678b21f884db54e66649748d2848b5d2c82 # Parent 5002462418f723ed09bea1ee9d08e91b841d539c ensure that the probe code runs in O(n) diff -r 5002462418f7 -r 428c1678b21f mp3.c --- a/mp3.c Mon Dec 03 04:50:01 2007 +0000 +++ b/mp3.c Mon Dec 03 08:27:04 2007 +0000 @@ -405,7 +405,7 @@ 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 @@ 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;