Message ID | a6d7c5e4-13c8-61d5-c945-3828acbd1a75@googlemail.com |
---|---|
State | Accepted |
Headers |
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: <ffmpeg-devel-bounces@ffmpeg.org> 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 <ffmpeg-devel@ffmpeg.org>; Wed, 19 Oct 2016 22:18:50 +0300 (EEST) Received: by mail-lf0-f65.google.com with SMTP id x23so3599290lfi.1 for <ffmpeg-devel@ffmpeg.org>; 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 <ffmpeg-devel@ffmpeg.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Oct 2016 12:18:52 -0700 (PDT) From: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> X-Google-Original-From: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Message-ID: <a6d7c5e4-13c8-61d5-c945-3828acbd1a75@googlemail.com> 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 <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <http://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <http://ffmpeg.org/pipermail/ffmpeg-devel/> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <http://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> |
Commit Message
Andreas Cadhalpun
Oct. 19, 2016, 7:18 p.m. UTC
This is similar to commit c143a9c.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
---
libavformat/aiffdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Oct 19, 2016 at 09:18:51PM +0200, Andreas Cadhalpun wrote: > This is similar to commit c143a9c. > > Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> > --- > libavformat/aiffdec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) can aiff work without block_align ? either way, block_duration is from the header reading if its still accurate then using it together with 1 instead of the matching block align is quite likely not correct OTOH if block_duration does not represent the actual content then the duration would only be correct by pure chance Its a bit unfortunate that theres no usecase with an undamaged sample which would have clear correct values one has to work on the assumptation of a use case where the user needs to override the codec and then ask "what is correct to do" that makes this a bit tricky ... [...]
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; }