avformat/matroskaenc: Fix potential overflow
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -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)
|
static void put_ebml_sint(AVIOContext *pb, uint32_t elementid, int64_t val)
|
||||||
{
|
{
|
||||||
int i, bytes = 1;
|
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)
|
while (tmp >>= 8)
|
||||||
bytes++;
|
bytes++;
|
||||||
|
Reference in New Issue
Block a user