• Bryan Huh's avatar
    avformat/cache: Avoid int-overflow in cache compare function · 72f9a634
    Bryan Huh authored
    cache protocol indexes its cache using AVTreeNodes which require a cmp
    function for inserting and searching new cache-entries. This cmp
    function expects a 32-bit int return value (negative, zero, or positive)
    but the cache cmp function returns an int64_t which can overflow the
    int, giving negative numbers for when it should be positive, vice versa.
    This manifests itself only for very large files (e.g. 4GB+)
    Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
    72f9a634
cache.c 8.65 KB