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
610efb67
Commit
610efb67
authored
Sep 30, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qt-faststart: dont allocate a bigger buffer than needed
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f4d9148f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
qt-faststart.c
tools/qt-faststart.c
+5
-2
No files found.
tools/qt-faststart.c
View file @
610efb67
...
@@ -37,6 +37,8 @@
...
@@ -37,6 +37,8 @@
#define ftello(x) _ftelli64(x)
#define ftello(x) _ftelli64(x)
#endif
#endif
#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
#define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1])
#define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1])
#define BE_32(x) ((((uint8_t*)(x))[0] << 24) | \
#define BE_32(x) ((((uint8_t*)(x))[0] << 24) | \
...
@@ -293,9 +295,10 @@ int main(int argc, char *argv[])
...
@@ -293,9 +295,10 @@ int main(int argc, char *argv[])
}
}
/* copy the remainder of the infile, from offset 0 -> last_offset - 1 */
/* copy the remainder of the infile, from offset 0 -> last_offset - 1 */
copy_buffer
=
malloc
(
COPY_BUFFER_SIZE
);
bytes_to_copy
=
FFMIN
(
COPY_BUFFER_SIZE
,
last_offset
);
copy_buffer
=
malloc
(
bytes_to_copy
);
if
(
!
copy_buffer
)
{
if
(
!
copy_buffer
)
{
printf
(
"could not allocate %"
PRIu64
" bytes for copy_buffer
\n
"
,
COPY_BUFFER_SIZE
);
printf
(
"could not allocate %"
PRIu64
" bytes for copy_buffer
\n
"
,
bytes_to_copy
);
goto
error_out
;
goto
error_out
;
}
}
printf
(
" copying rest of file...
\n
"
);
printf
(
" copying rest of file...
\n
"
);
...
...
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