From patchwork Thu Jan 26 01:12:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Cadhalpun X-Patchwork-Id: 2317 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp2471109vsb; Wed, 25 Jan 2017 17:12:25 -0800 (PST) X-Received: by 10.223.167.71 with SMTP id e7mr176422wrd.154.1485393145459; Wed, 25 Jan 2017 17:12:25 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n186si2500405wmn.80.2017.01.25.17.12.25; Wed, 25 Jan 2017 17:12:25 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@googlemail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BF44E68A6AC; Thu, 26 Jan 2017 03:12:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2134968A649 for ; Thu, 26 Jan 2017 03:12:21 +0200 (EET) Received: by mail-wm0-f65.google.com with SMTP id d140so46810712wmd.2 for ; Wed, 25 Jan 2017 17:12:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=I7P5j7UICRvmRewQHuVEvezY/3pFdBzc3MRKbZ/Xktw=; b=qoF7VAFNb8htqYoMBnt15gNG3d3KKdXhc6bZYS/uWEyGL1nNkVpdGLzTpzu1SPIg5y zu+cC/wV57yaiMfMIrMuMjxTOpLWNs1xInljg+SZZo47WJk3ijsAvfLw9NS8YV88YYad clXcki41O/l73m+UMeEPQ1hhq6nvaaOHRVKQsFNWLhMQHCdITU6Y0dVE5W4KmZaBGxVp V4PqX1aTXiK/oQm50cr1KGBlJxrA3zgTrMRYJJtw/e63gQcals9UXlC6rnupLv4ZKTfK uwFAMAKXs0HiY+5bjQ5q+I2qm2q/+kTTHet+MKpb9/aS8mmEJ5twVwBhrTqfCFKS71Yr +neA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=I7P5j7UICRvmRewQHuVEvezY/3pFdBzc3MRKbZ/Xktw=; b=CrvLyne+XhfDoCf4QSAgzip+ngtOb7g4NeqAt4FLDTnEL/FFRpE/BY2faghfGOpbEQ CYvY4bk5X52POTnNwF6ZRTi3qrBaRHUl73zu5/CRLa4iB1wApJAXRQnF2aCNnPz0fL82 t/XiV/00l9v/OF9XxVYJGomV7zgRA3PhpbTj9eLa5OJ382n/024PaOW0ZbxHXHZ903G6 eqao94Hr/JsrNmaj4AiBleg6UxFqbhwWAYsuYO3iFocZqAT8saGT/k/XsGbf4xaAsBYU ArSBKPVBy79VzMayaby3c6fbKELOYBtJCZxmv3ZWPDa/HwVaCTxuT+2+TDRMKIWIVMOV X2uw== X-Gm-Message-State: AIkVDXIG9hgeA0Ch4WzWnB+2L7yWPzJ/5eYA6O0vLVCgpmwOqKjhuS0eYhO61egyys69ag== X-Received: by 10.223.155.197 with SMTP id e5mr156066wrc.133.1485393141065; Wed, 25 Jan 2017 17:12:21 -0800 (PST) Received: from [192.168.2.21] (p5B0954C8.dip0.t-ipconnect.de. [91.9.84.200]) by smtp.googlemail.com with ESMTPSA id y65sm33979349wmb.5.2017.01.25.17.12.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jan 2017 17:12:20 -0800 (PST) From: Andreas Cadhalpun X-Google-Original-From: Andreas Cadhalpun To: FFmpeg development discussions and patches References: Message-ID: Date: Thu, 26 Jan 2017 02:12:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Subject: [FFmpeg-devel] [PATCH 4/9] ircamdec: prevent overflow during block alignment calculation X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Andreas Cadhalpun --- libavformat/ircamdec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavformat/ircamdec.c b/libavformat/ircamdec.c index 59f3a49411..e3196db84a 100644 --- a/libavformat/ircamdec.c +++ b/libavformat/ircamdec.c @@ -20,6 +20,7 @@ */ #include "libavutil/intreadwrite.h" +#include "libavcodec/internal.h" #include "avformat.h" #include "internal.h" #include "pcm.h" @@ -87,6 +88,11 @@ static int ircam_read_header(AVFormatContext *s) st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->channels = channels; + if (st->codecpar->channels > FF_SANE_NB_CHANNELS) { + av_log(s, AV_LOG_ERROR, "Too many channels %d > %d\n", + st->codecpar->channels, FF_SANE_NB_CHANNELS); + return AVERROR(ENOSYS); + } st->codecpar->sample_rate = sample_rate; st->codecpar->codec_id = ff_codec_get_id(tags, tag);