diff --git a/libavformat/cache.c b/libavformat/cache.c index 31f63e6b18..d41161d498 100644 --- a/libavformat/cache.c +++ b/libavformat/cache.c @@ -67,7 +67,7 @@ typedef struct Context { static int cmp(const void *key, const void *node) { - return (*(const int64_t *) key) - ((const CacheEntry *) node)->logical_pos; + return FFDIFFSIGN(*(const int64_t *)key, ((const CacheEntry *) node)->logical_pos); } static int cache_open(URLContext *h, const char *arg, int flags, AVDictionary **options)