aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-25 00:39:33 +0200
committerMartin Storsjö <martin@martin.st>2014-03-01 00:25:00 +0200
commit63848854256a024a19435e87d6bc76fffa65e81e (patch)
tree113a8a55857628ba86e9635ceadaeb01352ef092 /tools
parent03c2a66fcff9707f71ffef7e61ce5e3973220d4b (diff)
downloadffmpeg-63848854256a024a19435e87d6bc76fffa65e81e.tar.gz
qt-faststart: Check the ftello() return codes
This silences a warning in the coverity static analyzer. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'tools')
-rw-r--r--tools/qt-faststart.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/qt-faststart.c b/tools/qt-faststart.c
index 2b2e00ca57..5c511a0154 100644
--- a/tools/qt-faststart.c
+++ b/tools/qt-faststart.c
@@ -137,11 +137,11 @@ int main(int argc, char *argv[])
goto error_out;
}
if (fseeko(infile, -ATOM_PREAMBLE_SIZE, SEEK_CUR) ||
- fread(ftyp_atom, atom_size, 1, infile) != 1) {
+ fread(ftyp_atom, atom_size, 1, infile) != 1 ||
+ (start_offset = ftello(infile)) < 0) {
perror(argv[1]);
goto error_out;
}
- start_offset = ftello(infile);
} else {
int ret;
/* 64-bit special case */
@@ -202,6 +202,10 @@ int main(int argc, char *argv[])
goto error_out;
}
last_offset = ftello(infile);
+ if (last_offset < 0) {
+ perror(argv[1]);
+ goto error_out;
+ }
moov_atom_size = atom_size;
moov_atom = malloc(moov_atom_size);
if (!moov_atom) {