From patchwork Sun Oct 22 00:35:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 44304 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1b28:b0:15d:8365:d4b8 with SMTP id ch40csp662729pzb; Sat, 21 Oct 2023 17:36:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEOxznFCa2xava5t1iqfKKiKccYdTJA2R23TplNgULy2vxGhpgZK8GWBuoIOxP6WaNjn/wI X-Received: by 2002:a17:906:4fd0:b0:9c7:4dab:20ea with SMTP id i16-20020a1709064fd000b009c74dab20eamr5028939ejw.67.1697934961228; Sat, 21 Oct 2023 17:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697934961; cv=none; d=google.com; s=arc-20160816; b=hcPH2RyP5Cs2OW68AF0XNibpAfncXbW9pPHQOYdYyol4+sThKn93wrFxUjPyLQqaNb BumHiZq6TxUhVaf8HbpcaGHUBWzknvg1+4iglAfIqhjy4wpZq2nU21xMEtBCy17unWr5 Yc1yv2rkOLdLn7SEqui5ImQ4z56FOcetjA4wE0QeiHdog8C6z0IOrYpqlyLXVVlKaJMS Pz4R1/mvOSPyRdyndpM7jgGUjRfoYb3h/zF6u3+1gk7a7CvxlWdW/DdVVpa5VT1PDaPb KjkIkUCeO1AkilsU783SVCw07+3h+6eflc8NpyzcAdPO+4aAsfnUSC+PJJZG7IGRXWR8 6I1w== 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=8nUv4fy2CNJaYMP90yHpoLFyun9I6IXtYodNRb59Big=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=V0fpJeFA1dll0Rq4Licym/K22xntLWGGuOITOCF2+1s3mj2TMKXHXJGD79NJyv79m1 O+t2fzL8HUoKEIeDC4ODGq0uIWppyJ1fRH7hzKYlXGWLQiz4ZOjlLLylNNF/6RVo14Ra GdpkdnIINK78r6XZLqbY9XB2IFIwMwomyPFcIsX/d929TlXpdBUPp346Ekg591XMPnqh 3Kcq8nnfYIfnXOY/C8FEIEwEnZ/5db9z+/Xc2uKbZjyPqpGL3sS8A5YLVB0M6V7/jEOk e5T5CkHnvg3/NQJTEYLtJWSme+qGjeC7gt5O8pC3hnEivtFepkIyW4ZmxSQcO18GvPFS NBqw== 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 dr17-20020a170907721100b00988b6ffa850si1994769ejc.1028.2023.10.21.17.36.00; Sat, 21 Oct 2023 17:36:01 -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 D94A668CAC7; Sun, 22 Oct 2023 03:35:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F30EA68C968 for ; Sun, 22 Oct 2023 03:35:24 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2871FE0003 for ; Sun, 22 Oct 2023 00:35:23 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 22 Oct 2023 02:35:18 +0200 Message-Id: <20231022003520.17154-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231022003520.17154-1-michael@niedermayer.cc> References: <20231022003520.17154-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 4/6] avcodec/dovi_rpu: Use 64 bit in get_us/se_coeff() 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: ljJ6ZY+vDQqF Fixes: shift exponent 32 is too large for 32-bit type 'int' Fixes: 63151/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5067531154751488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/dovi_rpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c index f6485256c45..a6b23f4dd11 100644 --- a/libavcodec/dovi_rpu.c +++ b/libavcodec/dovi_rpu.c @@ -149,7 +149,7 @@ static inline uint64_t get_ue_coef(GetBitContext *gb, const AVDOVIRpuDataHeader case RPU_COEFF_FLOAT: fpart.u32 = get_bits_long(gb, 32); - return fpart.f32 * (1 << hdr->coef_log2_denom); + return fpart.f32 * (1LL << hdr->coef_log2_denom); } return 0; /* unreachable */ @@ -168,7 +168,7 @@ static inline int64_t get_se_coef(GetBitContext *gb, const AVDOVIRpuDataHeader * case RPU_COEFF_FLOAT: fpart.u32 = get_bits_long(gb, 32); - return fpart.f32 * (1 << hdr->coef_log2_denom); + return fpart.f32 * (1LL << hdr->coef_log2_denom); } return 0; /* unreachable */