1. 14 Nov, 2015 3 commits
    • Ganesh Ajjanagadde's avatar
      avutil/common: add av_rint64_clip · 6f520ce1
      Ganesh Ajjanagadde authored
      The rationale for this function is reflected in the documentation for
      it, and is copied here:
      
      Clip a double value into the long long amin-amax range.
      This function is needed because conversion of floating point to integers when
      it does not fit in the integer's representation does not necessarily saturate
      correctly (usually converted to a cvttsd2si on x86) which saturates numbers
      > INT64_MAX to INT64_MIN. The standard marks such conversions as undefined
      behavior, allowing this sort of mathematically bogus conversions. This provides
      a safe alternative that is slower obviously but assures safety and better
      mathematical behavior.
      API:
      @param a value to clip
      @param amin minimum value of the clip range
      @param amax maximum value of the clip range
      @return clipped value
      
      Note that a priori if one can guarantee from the calling side that the
      double is in range, it is safe to simply do an explicit/implicit cast,
      and that will be far faster. However, otherwise this function should be
      used.
      
      avutil minor version is bumped.
      Reviewed-by: 's avatarRonald S. Bultje <rsbultje@gmail.com>
      Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
      6f520ce1
    • Michael Niedermayer's avatar
      avcodec/ivi: Check image dimensions · df91aa03
      Michael Niedermayer authored
      Fixes integer overflow
      Fixes: 1e32c6c591d940337c20b197ec1c4d3d/asan_heap-oob_4a52e5_8946_0bb0d9e863def56005e49f1d89bdc94d.avi
      
      Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
      Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
      df91aa03
    • Michael Niedermayer's avatar
      avcodec/utils: Better check for channels in av_get_audio_frame_duration() · 4e16ad28
      Michael Niedermayer authored
      Fixes integer overflow
      Fixes: 0c2625f236ced104d402b4a03c0d65c7/asan_generic_274e1ce_5990_9314e7a67c26aecf011b178ade9f217c.avi
      
      Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
      Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
      4e16ad28
  2. 13 Nov, 2015 2 commits
    • Michael Niedermayer's avatar
      avcodec/jpeg2000dec: Check for duplicate SIZ marker · 44a7f17d
      Michael Niedermayer authored
      Fixes: 0231a17345734228011c6f35a64e4594/asan_heap-oob_1d92a72_3218_1213809a9e3affec77e4c191fdfdc0a9.mov
      
      Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
      Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
      44a7f17d
    • Bryan Huh's avatar
      avformat/async: Fix bug where async could not recover after seek to eof · d07585f0
      Bryan Huh authored
      When async issues its inner seek via ffurl_seek, it treats failures as
      EOF being reached. This is not consistent with the behavior of other
      protocols (e.g. http, cache) which continue to tolerate reads after
      failed seeks, and therefore does not interact correctly with them.
      
      A common pattern where this manifests itself is where avio_seek is
      called with pos to be the end-of-file - the http range-request would
      fail here, and async would set io_eof_reached to 1. The background
      thread would then refuse to read more bytes, and subsequent reads would
      only empty the fifo and end in an error.
      
      Presumably the code may have expected subsequent seeks to unset the
      io_eof_reached but this is not guaranteed to be true - a subsequent seek
      that lands in the AVIOContext's buffer (the fact that the
      previously-failed avio_seek leaves the AVIOContext's buffer intact also
      suggests that follow-up reads are expected to be tolerated) would not be
      issued to the async_seek function, and when that buffer is drained only
      async_read calls would follow, leading to the same error just described.
      Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
      d07585f0
  3. 12 Nov, 2015 6 commits
  4. 11 Nov, 2015 28 commits
  5. 10 Nov, 2015 1 commit