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 AE1FD406B0 for ; Sun, 27 Feb 2022 14:01:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AF19668B0F6; Sun, 27 Feb 2022 16:01:25 +0200 (EET) Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EAD9268996A for ; Sun, 27 Feb 2022 16:01:18 +0200 (EET) Received: by mail-yb1-f169.google.com with SMTP id e140so15421804ybh.9 for ; Sun, 27 Feb 2022 06:01:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=cDo/ixi3lWrjg8sXm8QvV/Z0iynQydaG/H+K5DaJHmU=; b=AT1HPYoUJWjwP6lIKC/uv47lsqW5sCzf6hE4KvWl+xyoXnMiQMYH0jLlOHeCHu3zpc 6/0t4Dilnmdzn1NT5MGIEm3Xm0KfcWBTYSe7WiMCnNyCEEB5nrOaS2UnIoA+rM+YweWh JoVtAa9TUGDxGogaCqdVlyYYeQR4yqFTOvR1u8+X9AiJKNR4BJSTgFftltfILSEGDYes SQX3BahecnoRxK0fPEx2Ry9BIGaX0IpLix6boSDkcF7jwb3Vx7FyPNWNBl6iCot4ctgp 0j5WppRwTKOllg3C/pnWJ4VWbNKZTAL8OonFoReWGmyvDIV9GrT6W6xPpYAiYvx67X0C +mmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=cDo/ixi3lWrjg8sXm8QvV/Z0iynQydaG/H+K5DaJHmU=; b=cLjeJY8UZW2XpsmjNQu9cajxCWKaubWZNpvD0s8pH/JU7o4ywpNvrwVD/UTl7zgNBH JXftjywRvIOPafQI5cLapp3EuSJklfoL4ij02xDzYU9OR1MUjTNaenNjeoHgBVL0sTvG Pz6/DpVbdZR3/zKW/QIMREnYerGYrZwWD5luH6CtLdLJIFiXMbQvz8XR75cfaGJay+rY 9eDS+1D5vsaWu4rUVvG+oWrZDa3IMBah3cChPn9SaUbnxAdevEY8cpvBLEvSfP30awEh J8lKfGSBhXZAMd67DofjdO2d/2lNkpSfU28Oocqrc+2TTFeEdqneUjS+F2Wv3YaSk5xc KOWA== X-Gm-Message-State: AOAM532KD0/IDpWlP2rCKe2mykSLd7AbcR7NgjkFqPbm5ZS2OzLbJ6LT qGS/QBe727JOIjBD//WGSRWM1f6rfnDoilUwMg3I3HZgHZw= X-Google-Smtp-Source: ABdhPJyKzsFKi28dSZx/zmSUbyD4WDr7Ctf58PBU6mTUapyD3orB4AQyiLsrgKgHglBDKnVC3/Y6IWPTlwCmSSRXquc= X-Received: by 2002:a25:e308:0:b0:624:b514:513c with SMTP id z8-20020a25e308000000b00624b514513cmr15033206ybd.586.1645970477417; Sun, 27 Feb 2022 06:01:17 -0800 (PST) MIME-Version: 1.0 References: <20220227135058.15739-1-michael@niedermayer.cc> In-Reply-To: <20220227135058.15739-1-michael@niedermayer.cc> From: Paul B Mahol Date: Sun, 27 Feb 2022 15:02:46 +0100 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] avcodec/g729_parser: Check channels 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sun, Feb 27, 2022 at 2:51 PM Michael Niedermayer wrote: > Fixes: signed integer overflow: 10 * 808464428 cannot be represented in > type 'int' > Fixes: assertion failure > Fixes: ticket9651 > LGTM Is it possible for parser get 0 channels as input, so it could theoretically loop forever? > > Signed-off-by: Michael Niedermayer > --- > libavcodec/g729_parser.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/libavcodec/g729_parser.c b/libavcodec/g729_parser.c > index 8c06ce4ee6..4dcdeab651 100644 > --- a/libavcodec/g729_parser.c > +++ b/libavcodec/g729_parser.c > @@ -48,6 +48,9 @@ static int g729_parse(AVCodecParserContext *s1, > AVCodecContext *avctx, > s->block_size = (avctx->bit_rate < 8000) ? G729D_6K4_BLOCK_SIZE : > G729_8K_BLOCK_SIZE; > if (avctx->codec_id == AV_CODEC_ID_ACELP_KELVIN) > s->block_size++; > + // channels > 2 is invalid, we pass the packet on unchanged > + if (avctx->channels > 2) > + s->block_size = 0; > s->block_size *= avctx->channels; > s->duration = avctx->frame_size; > } > -- > 2.17.1 > > _______________________________________________ > 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". > _______________________________________________ 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".