Message ID | 20240919225639.2376418-7-michael@niedermayer.cc |
---|---|
State | New |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp620164vqb; Thu, 19 Sep 2024 15:57:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU8Do2F3w9dA0GY08xd9wF3Av9HsJxny4T21u+tmRzv691hWVTC1XkXKGSeviQIrZTHALNH8nVzDwk2PdMvYv1T@gmail.com X-Google-Smtp-Source: AGHT+IGB0ioqmLNU8iAb1dEQ7q8Earp/yPeHm5qurBU2b7SFVcboBOPQnB0zHnYoxVTbyE0NzIGZ X-Received: by 2002:a05:6402:90b:b0:5c4:8b7:d93d with SMTP id 4fb4d7f45d1cf-5c464a42b12mr755793a12.18.1726786671021; Thu, 19 Sep 2024 15:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726786671; cv=none; d=google.com; s=arc-20240605; b=PyKeX0PIQiLGx8bbNXLWHqxJYJJ9rR6xlBoKycgk4HBAG4pKN2FM0COv+svKoXWsIR jl83K2Gauh4XOpLQF0ebmn4Qzj9oSwHEXJP8zDNaui8t8/6Mz5RrlF+G5WVrMU/CH7gd P7sJr5+uhgKhiz+W1OfAApPc1adyPDZrZoZ+dUDYKSaQwjYxOq34q62ku+tolrfRS2WB ZvgNV/ccm4Q6xS1j/L+uxzxIV3Xyt+je4WbcFUo1HVozyQ6MZ1sOK0I0rnWp4SItYt41 dgc8/a06vPzMxdjwvjJJkBtklymM4hitKlzxQtjar1tMc3rMtLs0UnSkUTekRvhCnbZ6 Aeiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=b+RBgtD0EGa9Va4AkP8LYcS9by9QsZAuT8m/9Kkffvs=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=bDBo1+VrWvvd5X+eiI+JacGpglKKGd39XAc7ZqfR7+uqu3NQx98ym7KvdrL/N1cB0X Pr9F8oGF0gIU73gJZyi3Ck3X8Ki8vpuWEv/3ISYM0mw2JwJq6NY3P1tx8VU/M4g9nxA1 LJsZ6mOS0r9qdO6WaYCBuZnpBOijpFQN/IPEDNzNNAdBM4blU4ExqOaV/i2os9Fgc5Wr WrB//Cc4znlqv1a3CfQ9SOUqvCaiIR7WlRY/TdBzohDlZNJPj47CxSvfPtAhhsrqwnm1 w0+Gtd5TEJRtVaTa/d0xwpJrAlWMA3eYXmj+3ixwDbW/yMXV0M3QSjoeCSge5mgiz//7 E/Bw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=R7CB0MQE; 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: <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 4fb4d7f45d1cf-5c42bb4f858si8523440a12.99.2024.09.19.15.57.50; Thu, 19 Sep 2024 15:57:51 -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=@niedermayer.cc header.s=gm1 header.b=R7CB0MQE; 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 08F6F68DD98; Fri, 20 Sep 2024 01:56:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BAAEE68DC68 for <ffmpeg-devel@ffmpeg.org>; Fri, 20 Sep 2024 01:56:45 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 01A7060004 for <ffmpeg-devel@ffmpeg.org>; Thu, 19 Sep 2024 22:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1726786605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hCBDEuFaj7eQ7mzIenLw1saMvBe0vO2YbocMO5gOXqQ=; b=R7CB0MQEMBBFNrmIb2QxZ429EvyPxu8vlNcrLXzHemwoLyzV0BG4twD8UqOWoW1ZQjyOED ezOrDdsqFvcWzxELC8BeD/9xp/9UpmhTlAqy9e2ZA3Ofi4/z5yF8hPIR1fFY5v/0SQwRdN ixCKg0ggxiCDyF6XKyEQ9sCjAdTEpz24qJqQFGEVZjvqPAhbuQLxtkXZQll5MXTWAixoBZ jGDdwre7ajZ2fj4PQP/lM3egW3W0sDZfnoFp1oE0+gGdv6P4iOUJRacQryJOWaN8AZvUrh HtZfYMCV5qSP2MdJnvuJsvOstjZsf2JMcM9TaaMwmqndLY961vuOqQLkmcfpow== From: Michael Niedermayer <michael@niedermayer.cc> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Date: Fri, 20 Sep 2024 00:56:37 +0200 Message-ID: <20240919225639.2376418-7-michael@niedermayer.cc> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240919225639.2376418-1-michael@niedermayer.cc> References: <20240919225639.2376418-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 7/9] avcodec/encode: Check bitrate X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://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="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> X-TUID: 2CUkjKl0EgVb |
Series |
None
|
expand
|
diff --git a/libavcodec/encode.c b/libavcodec/encode.c index bc5acf985d9..3baf5b8103b 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -764,6 +764,11 @@ int ff_encode_preinit(AVCodecContext *avctx) return AVERROR(EINVAL); } + if (avctx->bit_rate < 0) { + av_log(avctx, AV_LOG_ERROR, "The encoder bitrate is negative.\n"); + return AVERROR(EINVAL); + } + if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE && !(avctx->codec->capabilities & AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE)) { av_log(avctx, AV_LOG_ERROR, "The copy_opaque flag is set, but the "
Fixes: -1.80923e+19 is outside the range of representable values of type 'long' Fixes: 71103/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6542773681979392 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/encode.c | 5 +++++ 1 file changed, 5 insertions(+)