avformat/matroskaenc: Fix potential overflow

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
release/5.1
Andreas Rheinhardt 3 years ago
parent 625ea2d2a9
commit ca16863549
  1. 2
      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++;

Loading…
Cancel
Save