aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-05-01 21:05:28 +0000
committerMartin Storsjö <martin@martin.st>2010-05-01 21:05:28 +0000
commitd296a658cfd4a2fa4a7f5cdd8fa12726b34ed366 (patch)
tree0460535e692edb0168238ffcb34b93549da87562 /tools
parent331cb6c3e8e1d334ba366db67c895c3ff10c9a82 (diff)
downloadffmpeg-d296a658cfd4a2fa4a7f5cdd8fa12726b34ed366.tar.gz
qt-faststart: Free ftyp_atom at all exit points
Originally committed as revision 23008 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'tools')
-rw-r--r--tools/qt-faststart.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/qt-faststart.c b/tools/qt-faststart.c
index 7e9e5ebb4c..bcd5e478a6 100644
--- a/tools/qt-faststart.c
+++ b/tools/qt-faststart.c
@@ -169,6 +169,7 @@ int main(int argc, char *argv[])
if (atom_type != MOOV_ATOM) {
printf ("last atom in file was not a moov atom\n");
+ free(ftyp_atom);
fclose(infile);
return 0;
}
@@ -182,12 +183,14 @@ int main(int argc, char *argv[])
if (!moov_atom) {
printf ("could not allocate %"PRIu64" byte for moov atom\n",
atom_size);
+ free(ftyp_atom);
fclose(infile);
return 1;
}
if (fread(moov_atom, atom_size, 1, infile) != 1) {
perror(argv[1]);
free(moov_atom);
+ free(ftyp_atom);
fclose(infile);
return 1;
}
@@ -197,6 +200,7 @@ int main(int argc, char *argv[])
if (BE_32(&moov_atom[12]) == CMOV_ATOM) {
printf ("this utility does not support compressed moov atoms yet\n");
free(moov_atom);
+ free(ftyp_atom);
fclose(infile);
return 1;
}
@@ -213,6 +217,7 @@ int main(int argc, char *argv[])
if (i + atom_size - 4 > moov_atom_size) {
printf (" bad atom size\n");
free(moov_atom);
+ free(ftyp_atom);
return 1;
}
offset_count = BE_32(&moov_atom[i + 8]);
@@ -231,6 +236,7 @@ int main(int argc, char *argv[])
if (i + atom_size - 4 > moov_atom_size) {
printf (" bad atom size\n");
free(moov_atom);
+ free(ftyp_atom);
return 1;
}
offset_count = BE_32(&moov_atom[i + 8]);
@@ -255,6 +261,7 @@ int main(int argc, char *argv[])
if (!infile) {
perror(argv[1]);
free(moov_atom);
+ free(ftyp_atom);
return 1;
}
@@ -268,6 +275,7 @@ int main(int argc, char *argv[])
perror(argv[2]);
fclose(outfile);
free(moov_atom);
+ free(ftyp_atom);
return 1;
}