Browse Source

avformat/cache: Use int64_t to avoid int overflow in cache_read

Fixes an issue where an int64_t ffurl_seek return-value was being stored
in an int (32-bit) "r" variable, leading to integer overflow when seeking
into a large file (>2GB), and ultimately a "Failed to perform internal
seek" error mesage.

To test, try running `ffprobe 'cache:http://<something>'` on a file that
is ~3GB large, whose moov atom is at the end of the file

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.0
Bryan Huh Michael Niedermayer 10 years ago
parent
commit
d917f25658
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/cache.c

+ 1
- 1
libavformat/cache.c View File

@@ -156,7 +156,7 @@ static int cache_read(URLContext *h, unsigned char *buf, int size)
{
Context *c= h->priv_data;
CacheEntry *entry, *next[2] = {NULL, NULL};
int r;
int64_t r;

entry = av_tree_find(c->root, &c->logical_pos, cmp, (void**)next);



Loading…
Cancel
Save