From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 6B42E40BFA for ; Sat, 16 Mar 2024 08:32:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7DD9968D0BD; Sat, 16 Mar 2024 10:32:26 +0200 (EET) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4D80168D07E for ; Sat, 16 Mar 2024 10:32:20 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 85470E9E57 for ; Sat, 16 Mar 2024 09:32:19 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L5yX9CpgJL03 for ; Sat, 16 Mar 2024 09:32:17 +0100 (CET) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 43465E73E6 for ; Sat, 16 Mar 2024 09:32:17 +0100 (CET) Date: Sat, 16 Mar 2024 09:32:17 +0100 (CET) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20240316044116.1319-1-ffmpeg@gyani.pro> Message-ID: <2dd7a461-9c55-1d9c-cd65-1903abe32607@passwd.hu> References: <20240316044116.1319-1-ffmpeg@gyani.pro> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avformat/mpegtsenc: correct bitstream check X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sat, 16 Mar 2024, Gyan Doshi wrote: > 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 > --- > libavformat/mpegtsenc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c > index 06e88e9879..b8efc535a7 100644 > --- a/libavformat/mpegtsenc.c > +++ b/libavformat/mpegtsenc.c > @@ -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; > -- LGTM, thanks. Marton _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".