Skip to content
Snippets Groups Projects
  1. Dec 30, 2019
  2. Dec 13, 2019
    • Andreas Rheinhardt's avatar
      avformat/matroskadec: Fix use-after-free when demuxing ProRes · 48ae2358
      Andreas Rheinhardt authored
      
      ProRes in Matroska is supposed to not contain the first atom header
      (containing a size field and the tag "icpf") and therefore the Matroska
      demuxer has to recreate it; this involves an allocation and copy, of
      course. Whether the old buffer (containing the data without the atom
      header) needs to be freed or not depends upon whether it is what was
      directly read (in which case it is owned by an AVBuffer) or whether it
      has been allocated when reversing the track's content compression (e.g.
      zlib compression) that Matroska supports.
      
      So there are three pointers involved: The one pointing to the directly
      read data (owned by the AVBuffer), the one pointing to the currently
      valid data (which coincides with the former if no content compression
      needed to be reverted) and the one pointing to the new data with the
      first atom header. The check for whether to free the second of these is
      simply whether the first two are different.
      
      This works mostly, but there is a complication: Some muxers don't strip
      the first atom header away and in this case, it is also not reinserted
      and no new buffer is allocated; instead, the second and the third
      pointers agree. In this case, one must never free the second buffer.
      Yet it is currently done if the track is e.g. zlib compressed.
      This commit fixes this.
      
      This is a regression since b8e75a2a.
      
      Signed-off-by: default avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      Signed-off-by: default avatarJames Almer <jamrial@gmail.com>
      (cherry picked from commit af50f0a5)
      48ae2358
    • Andreas Rheinhardt's avatar
      avformat/matroskadec: Fix demuxing ProRes · 2f89f24e
      Andreas Rheinhardt authored
      
      The structure of a ProRes frame in mov/mp4 is that of a typical atom:
      First a 32 bit BE size field, then a tag detailling the content. Said
      size field includes the eight bytes of the atom header.
      
      This header is actually redundant, as the size of the atom is already
      known from the containing atom. It is therefore stripped away when muxed
      into Matroska and so the Matroska demuxer has to recreate upon demuxing.
      But it did not account for the fact that the size field includes the
      size of the header and this can lead to problems when a decoder uses the
      in-band size field.
      
      Fixes ticket #8210.
      
      Signed-off-by: default avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      Signed-off-by: default avatarJames Almer <jamrial@gmail.com>
      (cherry picked from commit 581419ea)
      2f89f24e
  3. Dec 12, 2019
  4. Dec 07, 2019
  5. Dec 03, 2019
  6. Nov 20, 2019
  7. Nov 19, 2019
  8. Nov 17, 2019
  9. Sep 28, 2019
  10. Sep 26, 2019
  11. Sep 24, 2019
  12. Sep 23, 2019
  13. Sep 06, 2019
  14. Sep 04, 2019
Loading