]> git.sesse.net Git - ffmpeg/blobdiff - tools/qt-faststart.c
Merge commit '1b891d17c531e8a63c2974aab4bf997ce70746f3'
[ffmpeg] / tools / qt-faststart.c
index 80c5d4bd101cd42773ee71e66031f28e11a904f9..3e2acd5e1b219dde4dba90409201a7b477a2da99 100644 (file)
@@ -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 */