1. 28 Mar, 2020 2 commits
    • Andreas Rheinhardt's avatar
      avcodec/avcodec, avpacket: Return blank packet on av_packet_ref() failure · c52ec036
      Andreas Rheinhardt authored
      Up until now, it was completely unspecified what the content of the
      destination packet dst was on error. Depending upon where the error
      happened calling av_packet_unref() on dst might be dangerous.
      
      This commit changes this by making sure that dst is blank on error, so
      unreferencing it again is safe (and still pointless). This behaviour is
      documented.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      c52ec036
    • Andreas Rheinhardt's avatar
      avcodec/avpacket: Always treat dst in av_packet_ref as uninitialized · e621f2b6
      Andreas Rheinhardt authored
      av_packet_ref() mostly treated the destination packet dst as uninitialized,
      i.e. the destination fields were simply overwritten. But if the source
      packet was not reference-counted, dst->buf was treated as if it pointed
      to an already allocated buffer (if != NULL) to be reallocated to the
      desired size.
      
      The documentation did not explicitly state whether the dst will be treated
      as uninitialized, but it stated that if the source packet is not refcounted,
      a new buffer in dst will be allocated. This and the fact that the side-data
      as well as the codepath taken in case src is refcounted always treated the
      packet as uninitialized means that dst should always be treated as
      uninitialized for the sake of consistency. And this behaviour has been
      explicitly documented.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      e621f2b6
  2. 27 Mar, 2020 13 commits
  3. 26 Mar, 2020 25 commits