avformat/matroskaenc: Fix potential overflow

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-01-16 10:18:34 +01:00
parent 625ea2d2a9
commit ca16863549
1 changed files with 1 additions and 1 deletions

View File

@ -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++;