[FFmpeg-trac] #2537(undetermined:new): ffurl_read_complete returns incorrect value

FFmpeg trac at avcodec.org
Mon May 6 04:28:58 CEST 2013


#2537: ffurl_read_complete returns incorrect value
-------------------------------------+-------------------------------------
             Reporter:  jyavenard    |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 This bug report is about the use of the avio's API amd ffurl_read_complete

 according to the documentation, ffurl_read_complete:
 {{{
 Read as many bytes as possible (up to size), calling the read function
 multiple times if necessary.

 This makes special short-read handling in applications unnecessary, if the
 return value is < size then it is certain there was either an error or the
 end of file was reached.

 Definition at line 310 of file avio.c.

 }}}

 The issue is actually in retry_transfer_wrapper in avio.c.

 If you try to read n-bytes of data using ffurl_read_complete when the
 current position in the file is less than n-bytes from the end.
 ffurl_read_complete will return AVERROR_EOF instead of the number of bytes
 actually read (and here the number of bytes returned would be less than
 the number of bytes asked).

 Expected behaviour:
 ffurl_read_complete when encountering an end of file, should return the
 number of bytes actually read, and set eof flags accordingly

 Background information.
 The issue was found trying to play file in #2513
 and reading the MOOV data. The MOOV table is located at the end of the
 file. MythTV seeks data from the file using ffurl_read_complete ; it would
 sometimes fail because we are enable to read the data close to the end of
 the file.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2537>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list