[FFmpeg-trac] #3769(undetermined:new): -moov_size option causes MOV file structure to be corrupted

FFmpeg trac at avcodec.org
Tue Jul 15 14:05:23 CEST 2014


#3769: -moov_size option causes MOV file structure to be corrupted
-------------------------------------+-------------------------------------
             Reporter:  rling        |                     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:
 Using the -moov_size option causes a 'free' atom to be added to the MOV
 file immediately after the 'moov' atom. The 'free' atom's size field is
 wrong, corrupting the file.
 How to reproduce:
 1. Encode a MOV file, determine required size of 'moov' atom by using a
 very small -moov_size:
 {{{
 % ffmpeg -y -i input.MOV -moov_size 1 output.MOV
 ffmpeg version N-64667-gd595361 Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Jul 14 2014 22:02:04 with gcc 4.8.3 (GCC)
 [...]
 [mov @ 04865620] reserved_moov_size is too small, needed 6135 additional.
 [...]
 }}}
 2. Required size is thus 6136 bytes. Use -moov_size option to require
 'moov' atom to be 20 bytes larger than required size:
 {{{
 % ffmpeg -y -i input.MOV -moov_size 6156 output.MOV
 }}}
 3. Examine output.MOV with a hex editor and look for the 'free' atom
 between the 'moov' and 'mdat' atoms:
 {{{
 017e00a 5d 6e 00 00 00 21 75 64 74 61 00 00 00 19 a9  .]n...!udta....©
 017f073 77 72 00 0d 55 c4 4c 61 76 66 35 35 2e 34 37  swr..UÄLavf55.47
 018002e 31 30 30 00 00 00 1c 66 72 65 65 00 00 00 00  .100....free....
 0181000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 0182000 00 00 00 00 00 00 00 00 0a 4a 9b 6d 64 61 74  ..........J.mdat
 0183000 00 02 ae 06 05 ff ff aa dc 45 e9 bd e6 d9 48  ...®..ÿÿªÜEé½æÙH
 }}}
 The atom's size field has been set to the size of the content only (28
 empty bytes), NOT including the 8 bytes for the header itself.  The size
 should include the 8 bytes for the atom header.  The MOV file is thus
 corrupt and cannot be parsed correctly with normal tools.

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


More information about the FFmpeg-trac mailing list