OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
916352f
)
cmdutils: add missing check for ftell() return
author
Michael Niedermayer
<michaelni@gmx.at>
Wed, 17 Oct 2012 22:10:59 +0000
(
00:10
+0200)
committer
Michael Niedermayer
<michaelni@gmx.at>
Wed, 17 Oct 2012 22:10:59 +0000
(
00:10
+0200)
Fixed CID703706
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
cmdutils.c
patch
|
blob
|
history
diff --git
a/cmdutils.c
b/cmdutils.c
index
f4474f6
..
0163faf
100644
(file)
--- a/
cmdutils.c
+++ b/
cmdutils.c
@@
-1303,6
+1303,10
@@
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
fseek(f, 0, SEEK_END);
*size = ftell(f);
fseek(f, 0, SEEK_SET);
+ if (*size == (size_t)-1) {
+ av_log(NULL, AV_LOG_ERROR, "IO error: %s\n", strerror(errno));
+ return AVERROR(errno);
+ }
*bufptr = av_malloc(*size + 1);
if (!*bufptr) {
av_log(NULL, AV_LOG_ERROR, "Could not allocate file buffer\n");