projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
68609ed
)
avformat/cache: cleanup cache file on cache write failure
author
Michael Niedermayer
<michaelni@gmx.at>
Fri, 26 Dec 2014 00:13:49 +0000
(
01:13
+0100)
committer
Michael Niedermayer
<michaelni@gmx.at>
Fri, 26 Dec 2014 00:13:49 +0000
(
01:13
+0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/cache.c
patch
|
blob
|
history
diff --git
a/libavformat/cache.c
b/libavformat/cache.c
index
0746e98
..
29b4a06
100644
(file)
--- a/
libavformat/cache.c
+++ b/
libavformat/cache.c
@@
-92,7
+92,7
@@
static int cache_open(URLContext *h, const char *arg, int flags)
static int add_entry(URLContext *h, const unsigned char *buf, int size)
{
Context *c= h->priv_data;
- int64_t pos;
+ int64_t pos
= -1
;
int ret;
CacheEntry *entry = av_malloc(sizeof(*entry));
CacheEntry *entry_ret;
@@
-132,6
+132,8
@@
static int add_entry(URLContext *h, const unsigned char *buf, int size)
return 0;
fail:
+ if (pos >= 0)
+ ftruncate(c->fd, pos);
av_free(entry);
av_free(node);
return ret;