[FFmpeg-trac] #10837(avformat:new): mp3_read_header might break seekback

FFmpeg trac at avcodec.org
Wed Jan 31 17:37:01 EET 2024


#10837: mp3_read_header might break seekback
----------------------------------+---------------------------------------
             Reporter:  noseglid  |                     Type:  defect
               Status:  new       |                 Priority:  normal
            Component:  avformat  |                  Version:  unspecified
             Keywords:  mp3       |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+---------------------------------------
 I've found an issue in ffmpeg 6.x.x and greater - and I've tracked it down
 to this commit:
 https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/0d17f5228f4d3854066ec1001f69c7d1714b0df9

 What happens here is that it tries to minimize the amount of seeks - but
 this breaks the `ffio_ensure_seekback` calls.

 `ffio_ensure_seekback` ensures seekback from the current position in the
 buffer.

 As the loop no longer seeks back to the beginning of the buffer every
 iteration of, it might move the buffer ahead of `off`.

 Before returning, it tries to reset the position to `off` or `off+i`
 depending if there's junk or not. If the buffer has moved ahead of this it
 will either;
   * Invoke a real seek if there is a `seek` function
   * Fail with `AVERROR(EPIPE)` if there is not.

 I think either this commit has to be reversed - or it must ensure seekback
 for the maximum bytes it might read (64*1024+4) before the loop starts.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10837>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list