[FFmpeg-cvslog] avformat/mp3dec: Ensure the buffer is large enough to avoid seeks from the first frame search

Michael Niedermayer git at videolan.org
Wed May 27 17:18:55 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed May 27 16:18:31 2015 +0200| [f722009ad99733e619273372ade56c4c1b9c3b02] | committer: Michael Niedermayer

avformat/mp3dec: Ensure the buffer is large enough to avoid seeks from the first frame search

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f722009ad99733e619273372ade56c4c1b9c3b02
---

 libavformat/mp3dec.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index a5374a1..07d7f54 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -374,6 +374,8 @@ static int mp3_read_header(AVFormatContext *s)
 
     off = avio_tell(s->pb);
     for (i = 0; i < 64 * 1024; i++) {
+        if (!(i&1023))
+            ffio_ensure_seekback(s->pb, i + 1024 + 4);
         if (check(s, off + i) >= 0) {
             av_log(s, AV_LOG_INFO, "Skipping %d bytes of junk at %lld.\n", i, (long long)off);
             avio_seek(s->pb, off + i, SEEK_SET);



More information about the ffmpeg-cvslog mailing list