1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avformat/mpegtsenc: correct bitstream check

8559cce3c3 made the bitstream check generic using a LUT.
However, one of the comparisons which involves a bitwise AND
and equality check is faulty due to operator precedence.

First reported and analysed at
https://github.com/streamlink/streamlink/issues/5876

Fixes #10908
This commit is contained in:
Gyan Doshi 2024-03-16 10:04:54 +05:30
parent aca7037e01
commit f5441e441f

View File

@ -2319,7 +2319,7 @@ static int mpegts_check_bitstream(AVFormatContext *s, AVStream *st,
pkt->size >= 5 && AV_RB32(pkt->data) != 0x0000001 &&
(AV_RB24(pkt->data) != 0x000001 ||
(st->codecpar->extradata_size > 0 &&
(st->codecpar->extradata[0] & e->mask == e->value))))
((st->codecpar->extradata[0] & e->mask) == e->value))))
return ff_stream_add_bitstream_filter(st, e->bsf_name, NULL);
}
return 1;