mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-08-10 17:14:41 +00:00
avformat/ty: don't let the Series2 AC3 trim underflow the packet size
Fixes: negative-size-param Fixes: ty-s2-ac3-negative-size-single-file.ffconcat / create_poc.py Fixes: g0qeE6KvrjZi Found-by: Adrian Junge (vurlo)
This commit is contained in:
committed by
michaelni
parent
a7e38b617b
commit
de771bd527
@@ -578,7 +578,7 @@ static int demux_audio(AVFormatContext *s, TyRecHdr *rec_hdr, AVPacket *pkt)
|
||||
if (ty->audio_type == TIVO_AUDIO_AC3 &&
|
||||
ty->tivo_series == TIVO_SERIES2) {
|
||||
if (ty->ac3_pkt_size + pkt->size > AC3_PKT_LENGTH) {
|
||||
pkt->size -= 2;
|
||||
pkt->size -= FFMIN(pkt->size, 2);
|
||||
ty->ac3_pkt_size = 0;
|
||||
} else {
|
||||
ty->ac3_pkt_size += pkt->size;
|
||||
|
||||
Reference in New Issue
Block a user