From patchwork Sun Apr 9 14:26:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 41077 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4645:b0:e3:3194:9d20 with SMTP id eb5csp1598802pzb; Sun, 9 Apr 2023 07:27:21 -0700 (PDT) X-Google-Smtp-Source: AKy350b3PcyXYJcHai+3VillKSOonJMbu+AI42vHfQhiXmC+Lje1zIpUZc6/ToD9K9jRqTM8VnJk X-Received: by 2002:a17:906:24d7:b0:941:1cf6:dbea with SMTP id f23-20020a17090624d700b009411cf6dbeamr6535905ejb.55.1681050441420; Sun, 09 Apr 2023 07:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681050441; cv=none; d=google.com; s=arc-20160816; b=M8CapfSeLQGG0/Se7MUt/kKpwCPz2BRl3pKSOul0vJOgaAiQa6xI82eEmXTIFqo5qO OdmSTfAaNXoQdy9P/IWjSsZKYtn6qdEkMg3TZLa1nE0YcmOJLDCv1JdfrOEgaouSh6hG oQJJj75d3DG1FPWBAEiqrGOXZfE3g8OgNtVvEMZA0gt0utTrvRWdnQAEtT+bbb5RiRvZ j1+K6DbRzBZfCcma+/t8JmI2eX4iyIE5+msIR7nrLYBhbHUlWUz6ep4PNa+gh6WDEvFX MsyHHVZEibfqkhf3B8GafEI9XIEqx6+D8az8D2TZjODJNr5qyWfe5ZRvkpjA+68JobgS BJiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=7ZjfT9gQYNzEQqS9g8i/obL+IRVvgu8h+XRKEqr7ITQ=; b=Wt9M9eUEnYWL5ubPr7rDRi52ziLyniRqGAFGpXzDKNqRJjE4ocGamQQJ4KjMlPKzSL wcsn7kcHhf20c4pko5RqMPvqOqoYZ08JniSzd960CoDrKRyIXJ5mXn80/o+LJFFgtGMc mTI4k4M8WoL48f8Na78ACamhFtnk2g25GanF30X00tTJ95t0J9RBVyhVbcc4NaSoe6zX 2oEJenOISlT/lh7QS6i8K5CBX8uHZCRDptDQJyuncUC25kkMXIG6u2NOwfage/mdFpD3 1zEYSZoVem6qxMafxVrIEuJB5IvKZnpgnSutNpFfHoF6C33b4rWeGROeqnjTyNn6WvJh +A2w== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hp7-20020a1709073e0700b00946e67fcf7fsi8957511ejc.124.2023.04.09.07.27.20; Sun, 09 Apr 2023 07:27:21 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9024C68BE11; Sun, 9 Apr 2023 17:26:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ED6AC68BE0F for ; Sun, 9 Apr 2023 17:26:33 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 4D01820002 for ; Sun, 9 Apr 2023 14:26:33 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 9 Apr 2023 16:26:27 +0200 Message-Id: <20230409142627.19820-6-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230409142627.19820-1-michael@niedermayer.cc> References: <20230409142627.19820-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 6/6] avformat/rka: Fix division by 0 for bps < 8 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3G3WLVmWTS1H Fixes: division by zero Fixes: 57828/clusterfuzz-testcase-minimized-ffmpeg_dem_RKA_fuzzer-6571818338353152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/rka.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/rka.c b/libavformat/rka.c index 39e5b3bce12..c83a17c92cc 100644 --- a/libavformat/rka.c +++ b/libavformat/rka.c @@ -100,7 +100,7 @@ static int rka_read_header(AVFormatContext *s) break; } - if ((r = av_add_index_entry(st, framepos, (i * 131072LL) / (channels * (bps >> 3)), + if ((r = av_add_index_entry(st, framepos, (i * 131072LL*8) / (channels * bps), size, 0, AVINDEX_KEYFRAME)) < 0) return r; framepos += size;