mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2025-01-09 05:13:12 +00:00
mpegts: prevent get_bits64() from reading nonsense at the end.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
d629f3edaa
commit
4a310a19de
@ -693,6 +693,9 @@ static void new_pes_packet(PESContext *pes, AVPacket *pkt)
|
||||
static uint64_t get_bits64(GetBitContext *gb, int bits)
|
||||
{
|
||||
uint64_t ret = 0;
|
||||
|
||||
if (get_bits_left(gb) < bits)
|
||||
return AV_NOPTS_VALUE;
|
||||
while (bits > 17) {
|
||||
ret <<= 17;
|
||||
ret |= get_bits(gb, 17);
|
||||
|
Loading…
Reference in New Issue
Block a user