Without this cast, the BE_32() expression is sign extended when
assigned to an uint64_t, since the uint8_t|uint8_t expression
is promoted to an int.
Also avoid undefined behaviour when left shifting an uint8_t
by 24 by casting it to an uint32_t explicitly before shifting.
Based on a patch by Michael Niedermayer.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit ea7f79f93796d68559a495be824b6bbd94dfe5f6)
This silences a warning in the coverity static analyzer.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 63848854256a024a19435e87d6bc76fffa65e81e)
These variables are assigned the return values of ftello, which
returns an off_t, which is a signed type. On errors, ftello returns
-1, thus make sure this error return value can be stored properly.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 03c2a66fcff9707f71ffef7e61ce5e3973220d4b)
qt-faststart doesn't use the normal libav headers at all since
it's supposed to be a completely standalone tool, so we implement
the macro locally in this file.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit ea15a9a5d8fa6a71af3101b2af18c4dcac07987f)
Copying data in chunks of 1 KB is a little wasteful.
64 KB should still easily fit on the stack, so there's no need
to allocate it dynamically.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 3cbc7ef3d60b6af3617079f24a4f401d83353003)
If the atom size is 0, qt-faststart currently hangs forever while scanning
the file.
Originally committed as revision 23129 to svn://svn.ffmpeg.org/ffmpeg/trunk
Feel free to revert if you can specify a concrete case where this actually
is necessary.
Originally committed as revision 23006 to svn://svn.ffmpeg.org/ffmpeg/trunk