From patchwork Wed Oct 19 20:41:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Cadhalpun X-Patchwork-Id: 1081 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp364882vsd; Wed, 19 Oct 2016 13:41:34 -0700 (PDT) X-Received: by 10.25.76.7 with SMTP id z7mr7648354lfa.126.1476909694824; Wed, 19 Oct 2016 13:41:34 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k82si5088578lfe.100.2016.10.19.13.41.34; Wed, 19 Oct 2016 13:41:34 -0700 (PDT) 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 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 A39A4689736; Wed, 19 Oct 2016 23:41:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CBA98689258 for ; Wed, 19 Oct 2016 23:41:21 +0300 (EEST) Received: by mail-lf0-f65.google.com with SMTP id b75so3916686lfg.3 for ; Wed, 19 Oct 2016 13:41:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=Yj5TVqd2uKMFNxtyIPvBKGbWNDk0+f1KxCGqfQlX3Vw=; b=yNUnFSG+LM6AhEueWDegzNBS3zEv1oSrjYoysxl1m917jy8EH7lg+jsvlj61+XQRym 1KZyBozBHjdYVF+6db5+3UMJrCZ2w4yNrCeLaibKZgo3DmgTKe4sBPfPGyn6PhK4QXhu wUkU+6QozGVwIvWfXmCZsIE91nNUu9ILHvNIGRy9utdv/9n2K3oUJSo6FG46Q/8MIfIp 2uFlMWhENAWARJjnwELoJbLhtHW3wNNrh6M61sp/c7P+6tBAIY+XGZGqUmCiwDhQWhvH 6Pvmjq1Trj08Ko01Vo8dQPBWc35KUdYZpw/7xZyOCiTky0rv7gxkw9pZegPiKm3rQqyb cyag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=Yj5TVqd2uKMFNxtyIPvBKGbWNDk0+f1KxCGqfQlX3Vw=; b=gzvMgRqckSDiBxgDjqRWtekAYCsCm0lS2cW6JL7UTGRUbI59g9kSMsQLMUU1gPK9rz tW4D2MTFmpNqLPoAapJGZnrZ4s7yttY4e6unccoF0jfOV4S0sIulFPUkg3qkDJNIYElk WppBAb3ju/HENVfEWLLAbZ8WMOzxlZyeRgYNdHhzZG2a2TzAbnk70ZIrFUD+zMTp6A4U Cibj4PXSm7dJvegTEOHexI44v8cI8I+3/Etq1n54t2oMeDniiQxDozUWQF6A3oFf84A7 752MtdZjoItYUVSr4euoZ0PYzN93Ye3N41XkfEI1xBcdD4zgjqXgJCjpci4YN7ODV0k6 B7VQ== X-Gm-Message-State: AA6/9RlHjnvw2RLVjRqxvaetsw+6HlvJLTBq1SErbBoP9R+x/iHgmLPHdhCmT4SIXoNXoQ== X-Received: by 10.28.181.68 with SMTP id e65mr6594453wmf.131.1476909683882; Wed, 19 Oct 2016 13:41:23 -0700 (PDT) Received: from [192.168.2.20] (pD9E8EB58.dip0.t-ipconnect.de. [217.232.235.88]) by smtp.googlemail.com with ESMTPSA id hb5sm71812990wjc.5.2016.10.19.13.41.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Oct 2016 13:41:23 -0700 (PDT) From: Andreas Cadhalpun X-Google-Original-From: Andreas Cadhalpun To: FFmpeg development discussions and patches Message-ID: Date: Wed, 19 Oct 2016 22:41:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] dcstr: fix division by zero 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/dcstr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dcstr.c b/libavformat/dcstr.c index 69fae41..d5d2281 100644 --- a/libavformat/dcstr.c +++ b/libavformat/dcstr.c @@ -47,7 +47,7 @@ static int dcstr_read_header(AVFormatContext *s) avio_skip(s->pb, 4); st->duration = avio_rl32(s->pb); st->codecpar->channels *= avio_rl32(s->pb); - if (!align || align > INT_MAX / st->codecpar->channels) + if (!align || !st->codecpar->channels || align > INT_MAX / st->codecpar->channels) return AVERROR_INVALIDDATA; st->codecpar->block_align = align * st->codecpar->channels;