Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
56122443
Commit
56122443
authored
Oct 22, 2012
by
Michael Niedermayer
Committed by
Martin Storsjö
Feb 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qt-faststart: Check fseeko() return codes
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
ea15a9a5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
qt-faststart.c
tools/qt-faststart.c
+18
-6
No files found.
tools/qt-faststart.c
View file @
56122443
...
@@ -136,22 +136,27 @@ int main(int argc, char *argv[])
...
@@ -136,22 +136,27 @@ int main(int argc, char *argv[])
atom_size
);
atom_size
);
goto
error_out
;
goto
error_out
;
}
}
fseeko
(
infile
,
-
ATOM_PREAMBLE_SIZE
,
SEEK_CUR
);
if
(
fseeko
(
infile
,
-
ATOM_PREAMBLE_SIZE
,
SEEK_CUR
)
||
if
(
fread
(
ftyp_atom
,
atom_size
,
1
,
infile
)
!=
1
)
{
fread
(
ftyp_atom
,
atom_size
,
1
,
infile
)
!=
1
)
{
perror
(
argv
[
1
]);
perror
(
argv
[
1
]);
goto
error_out
;
goto
error_out
;
}
}
start_offset
=
ftello
(
infile
);
start_offset
=
ftello
(
infile
);
}
else
{
}
else
{
int
ret
;
/* 64-bit special case */
/* 64-bit special case */
if
(
atom_size
==
1
)
{
if
(
atom_size
==
1
)
{
if
(
fread
(
atom_bytes
,
ATOM_PREAMBLE_SIZE
,
1
,
infile
)
!=
1
)
{
if
(
fread
(
atom_bytes
,
ATOM_PREAMBLE_SIZE
,
1
,
infile
)
!=
1
)
{
break
;
break
;
}
}
atom_size
=
BE_64
(
&
atom_bytes
[
0
]);
atom_size
=
BE_64
(
&
atom_bytes
[
0
]);
fseeko
(
infile
,
atom_size
-
ATOM_PREAMBLE_SIZE
*
2
,
SEEK_CUR
);
ret
=
fseeko
(
infile
,
atom_size
-
ATOM_PREAMBLE_SIZE
*
2
,
SEEK_CUR
);
}
else
{
}
else
{
fseeko
(
infile
,
atom_size
-
ATOM_PREAMBLE_SIZE
,
SEEK_CUR
);
ret
=
fseeko
(
infile
,
atom_size
-
ATOM_PREAMBLE_SIZE
,
SEEK_CUR
);
}
if
(
ret
)
{
perror
(
argv
[
1
]);
goto
error_out
;
}
}
}
}
printf
(
"%c%c%c%c %10"
PRIu64
" %"
PRIu64
"
\n
"
,
printf
(
"%c%c%c%c %10"
PRIu64
" %"
PRIu64
"
\n
"
,
...
@@ -192,7 +197,10 @@ int main(int argc, char *argv[])
...
@@ -192,7 +197,10 @@ int main(int argc, char *argv[])
/* moov atom was, in fact, the last atom in the chunk; load the whole
/* moov atom was, in fact, the last atom in the chunk; load the whole
* moov atom */
* moov atom */
fseeko
(
infile
,
-
atom_size
,
SEEK_END
);
if
(
fseeko
(
infile
,
-
atom_size
,
SEEK_END
))
{
perror
(
argv
[
1
]);
goto
error_out
;
}
last_offset
=
ftello
(
infile
);
last_offset
=
ftello
(
infile
);
moov_atom_size
=
atom_size
;
moov_atom_size
=
atom_size
;
moov_atom
=
malloc
(
moov_atom_size
);
moov_atom
=
malloc
(
moov_atom_size
);
...
@@ -268,7 +276,11 @@ int main(int argc, char *argv[])
...
@@ -268,7 +276,11 @@ int main(int argc, char *argv[])
}
}
if
(
start_offset
>
0
)
{
/* seek after ftyp atom */
if
(
start_offset
>
0
)
{
/* seek after ftyp atom */
fseeko
(
infile
,
start_offset
,
SEEK_SET
);
if
(
fseeko
(
infile
,
start_offset
,
SEEK_SET
))
{
perror
(
argv
[
1
]);
goto
error_out
;
}
last_offset
-=
start_offset
;
last_offset
-=
start_offset
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment