summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-16 10:18:34 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-19 11:21:53 +0100
commitca168635494276bb7f2f686de07747e7f493e30c (patch)
tree82fdfd60152b9264ab780f5260d461064c43b4c5
parent625ea2d2a901f8717c90bac286982774075557bd (diff)
avformat/matroskaenc: Fix potential overflow
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavformat/matroskaenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 41b2df7dbf..1dde12a7d9 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -286,7 +286,7 @@ static void put_ebml_uint(AVIOContext *pb, uint32_t elementid, uint64_t val)
static void put_ebml_sint(AVIOContext *pb, uint32_t elementid, int64_t val)
{
int i, bytes = 1;
- uint64_t tmp = 2*(val < 0 ? val^-1 : val);
+ uint64_t tmp = 2 * (uint64_t)(val < 0 ? val^-1 : val);
while (tmp >>= 8)
bytes++;