diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 07f4539723..9247a75885 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -806,7 +806,7 @@ static int ebml_read_sint(AVIOContext *pb, int size, int64_t *num) /* big-endian ordering; build up number */ while (n++ < size) - *num = (*num << 8) | avio_r8(pb); + *num = ((uint64_t)*num << 8) | avio_r8(pb); } return 0;