From patchwork Wed Oct 19 19:18:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Cadhalpun X-Patchwork-Id: 1080 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp338892vsd; Wed, 19 Oct 2016 12:19:03 -0700 (PDT) X-Received: by 10.194.205.1 with SMTP id lc1mr5190472wjc.192.1476904743851; Wed, 19 Oct 2016 12:19:03 -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 cz6si55953781wjb.155.2016.10.19.12.19.02; Wed, 19 Oct 2016 12:19:03 -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 F04CA689254; Wed, 19 Oct 2016 22:18:57 +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 CFDD46891DD for ; Wed, 19 Oct 2016 22:18:50 +0300 (EEST) Received: by mail-lf0-f65.google.com with SMTP id x23so3599290lfi.1 for ; Wed, 19 Oct 2016 12:18:53 -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=HQ5OPvYbIj93mkzRzaV410DMrvrJpgYVX88P0bmzc+E=; b=AtgOb5lPR6H8adrTGR/sprx2gKyBtCUQ/SnncwPoCt0cSXLq7h7AZHpXXwArl+FlPM tIoXPv5r/oIbUvXxX4l/NwWZanxnMpkAaTe0iXUDBKrjTsNoJfYW1d3+RUSVOuJY3xm9 97mkD4ZlM+3hirCzinbpEwng9KBjsT6PxlOdfWMSRb3AXny0+8IYJkNYr4kpz5Fy5hX7 R9ueYs/avsSgtSD6NwKQmraHhbNOVwjmdNyWw1458cxYKq6hkRDlacv5lgFK8aHZE3HE MrjoZbYMy2KpgaHBKNug9yLXhvxhb2F35UUu/s3WSloXyYA/H9DjXCeLCNQJHNEbvL2I 5lzg== 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=HQ5OPvYbIj93mkzRzaV410DMrvrJpgYVX88P0bmzc+E=; b=adnDWPR0NMwzjyNQuFvbEziuXmbOtVLI82D7N/GZgBY+2tRqx4102QMyz2nNY/pp95 HS4SC9YInoyyapIwGFlZCk6WKruljcESPPeUwwJMKdB840nAl01t9os/2p14Gp/e0BLU skhJRbn68zBxA3D8O/weMLjvgbvC0EFLCq649PyyxuHYQ02aUlv7SujxibM3ArzgzFK1 QGnKTUAKzMg86W5Yg0cbJwKOjToHE8UhTF2KkX2AvYe6crS0rFOkRPVyPZCPSvVJ5tCj VBzdgZsPpKsUtJQiBMGYVNaJSxpuQcFV6zn6CjATEJRrUPHss0hCkI0SI5WeCRi2U+sc 7IGg== X-Gm-Message-State: AA6/9Rlg7w12qK0WIOnO39D5LXGD+H0POEiAZLhM9BLjNCl8JnxD7JAHRENfD6aOUKtDjA== X-Received: by 10.25.198.209 with SMTP id w200mr7332683lff.175.1476904732894; Wed, 19 Oct 2016 12:18:52 -0700 (PDT) Received: from [192.168.2.21] (pD9E8EB58.dip0.t-ipconnect.de. [217.232.235.88]) by smtp.googlemail.com with ESMTPSA id i136sm9135648lfg.36.2016.10.19.12.18.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Oct 2016 12:18:52 -0700 (PDT) From: Andreas Cadhalpun X-Google-Original-From: Andreas Cadhalpun To: FFmpeg development discussions and patches Message-ID: Date: Wed, 19 Oct 2016 21:18:51 +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] aiffdec: 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" This is similar to commit c143a9c. Signed-off-by: Andreas Cadhalpun --- libavformat/aiffdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index de82787..d96fc1d 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -391,7 +391,7 @@ static int aiff_read_packet(AVFormatContext *s, pkt->flags &= ~AV_PKT_FLAG_CORRUPT; /* Only one stream in an AIFF file */ pkt->stream_index = 0; - pkt->duration = (res / st->codecpar->block_align) * aiff->block_duration; + pkt->duration = (res / (st->codecpar->block_align ? st->codecpar->block_align : 1)) * aiff->block_duration ; return 0; }