From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 7174A44A30 for ; Sun, 6 Nov 2022 08:52:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BF0E868B56D; Sun, 6 Nov 2022 10:52:06 +0200 (EET) Received: from mail-vk1-f180.google.com (mail-vk1-f180.google.com [209.85.221.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EB9E968B14C for ; Sun, 6 Nov 2022 10:51:59 +0200 (EET) Received: by mail-vk1-f180.google.com with SMTP id g4so4851753vkk.6 for ; Sun, 06 Nov 2022 01:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=+ovV7ZZCAvLnhBJb/vOhP2QI68oeuZxCSeju5U6/hZ0=; b=CRyJixZ+sIGRLbD2aDEZEig6KlG61bFPZOs3zfbYUizkbbqAEv8SjtdwkZfhLwF+Ty d2Sn0RQIWpW64bZ+OzagzqTV3AbfOYCEXNU/AbSeRNf8uNQCAPQD5i0NhoweUhaHKdLK 0OnAP0Nno2506I/Ph7FtwNtWnk9WjreWGxLJPjqJricCJiqIy+MVsIcwIGZUxtx00BiK MdYdXTm3ClXB3ozmMAqCBG1jgWHw7eThzH4J1HdscYL743GiAdRJqDuz+BxWaGBCDfke uPfazM9PM7hWLvdWhGSfxDOlCrsz9BTwcqOCHgXBGuWL1I2F5jIsi3kLyaJJyG1Bp5Ki VPUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+ovV7ZZCAvLnhBJb/vOhP2QI68oeuZxCSeju5U6/hZ0=; b=D2/B+xtxcvV5eCqGKAozqRej6GDJMRNxa9bjMCE9qjLRzEmNO+EkvQVZoOAOzJw2g+ 5KXTBu98/+pebzlHy45N6s1IZO6QaAbPD7HxtbaqwSxU97VDGaHtX4aHbVNDTlul+kCS s24iAtL0GANShq98EbyqbvQmEMu9DALyC6MLVfa0RMXEhr7dtmhkqeTsq+bL+1qz3NeX qTc5BU+xRSvcR/zyk97crniXItNYiHb6ToXd/ZqVL3gLLqItBroGNe0dTsqOKpqbeV/S 0c8LM1sBoQN1jloP6e6oOcRbJwlGvqOXwWqtpbG8YzxlrlDVLjOTFetmTTMb/rzNKure fllw== X-Gm-Message-State: ACrzQf0OS3WTUKFA02O72Pj3/Jh0ZS8GGX4AYEg1kx0mLNJPVJGc3gXE DLFgUKhj66pA0WLYjZcdi78rAcbFXZYWh2KW+aRHpGtB X-Google-Smtp-Source: AMsMyM53+zCvg/eNG2VRxGcnffRJ1eHFhdC4eW/9Jp/gSDmD8hHhzNzx1ukCgacv8WZRAKlN+ZH+a+kB0HujYp2BUfg= X-Received: by 2002:a1f:280a:0:b0:3b7:82e4:f3a1 with SMTP id o10-20020a1f280a000000b003b782e4f3a1mr6402314vko.17.1667724718621; Sun, 06 Nov 2022 01:51:58 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:612c:612:b0:314:ac6a:1eb7 with HTTP; Sun, 6 Nov 2022 01:51:57 -0700 (PDT) In-Reply-To: <20221105201629.1980-3-michael@niedermayer.cc> References: <20221105201629.1980-1-michael@niedermayer.cc> <20221105201629.1980-3-michael@niedermayer.cc> From: Paul B Mahol Date: Sun, 6 Nov 2022 09:51:57 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH 3/4] avcodec/bonk: Check unquant for overflow 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 11/5/22, Michael Niedermayer wrote: > Fixes: signed integer overflow: -2889074 * 2048 cannot be represented in > type 'int' > Fixes: > 51363/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-5660734784143360 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/bonk.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/bonk.c b/libavcodec/bonk.c > index 471e09fe14..1695229dbd 100644 > --- a/libavcodec/bonk.c > +++ b/libavcodec/bonk.c > @@ -363,12 +363,17 @@ static int bonk_decode(AVCodecContext *avctx, AVFrame > *frame, > return ret; > > for (int i = 0; i < samples_per_packet; i++) { > + int64_t t64; > for (int j = 0; j < s->down_sampling - 1; j++) { > sample[0] = predictor_calc_error(s->k, state, s->n_taps, > 0); > sample++; > } > > - sample[0] = predictor_calc_error(s->k, state, s->n_taps, > s->input_samples[i] * quant); > + t64 = s->input_samples[i] * (int64_t)quant; > + if ((int32_t)t64 != t64) > + return AVERROR_INVALIDDATA; > + > + sample[0] = predictor_calc_error(s->k, state, s->n_taps, t64); > sample++; > } > NAK, using int64_t and thus slowing things down. > -- > 2.17.1 > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".