From patchwork Wed Jul 31 19:54:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 50834 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:12d6:0:b0:489:2eb3:e4c4 with SMTP id 205csp712803vqs; Wed, 31 Jul 2024 12:54:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWCyNy9xlknoX8vbqpb8hUkYoYBJZUEhwHqXJSYiIS3lmPS4flnnV3fppQMypIRN+j7bmSvKtfiy7zkkBSMhndHaSdDO3Y7WYSXeA== X-Google-Smtp-Source: AGHT+IHLAu5N1rnI4RqA+CtvTsp/AxI6SdL5G3PAFMIRJbMTFME80D84GxxwUFLU1qrTrcd/EOqU X-Received: by 2002:a2e:9dce:0:b0:2ec:53a8:4b3e with SMTP id 38308e7fff4ca-2f1533a9913mr2684021fa.38.1722455661708; Wed, 31 Jul 2024 12:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722455661; cv=none; d=google.com; s=arc-20160816; b=Y72ZIlPB4L5a+Pi0CQWOultAzBxcdj9mBnn+BzX71oYXg8Sz6QjLmxPfHlNYm8HN8O HjGeVtWmgBs8u8EwoDNICxxQlJvjTlLzLmDCj++GQOpkZ8xCbgiB6i41XYw5OXfRP2ET 4LlEHMUFPIf61lbDrdFf4tHCbWKTtND9jgKN3e3bPimX2HwXoibxPM2mgnYSqhUozCFw A6enaLarI6d4CxNKjq2irdNZj4g+TLr68MsboIcfKK5bmSBVydrIn/16NfG8GcTqYIJD oNlKfRoB1D1wCCQobeoN6VaNcmA9/xBu+2CYo2Xd+k7FIXqC6DN0Uql2NpFQ8Dhl1TbR QAQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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:message-id:date:to:from :dkim-signature:delivered-to; bh=+zsFX//hc/+DsZwPmqkMMlVaEarZMCCLwt6wKLxtBoc=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=SF41s4aE5wQQD/njCe3H1Yvhu85pe4O/Qfi/7I64BIHULqsgQxq8oSiN6zx8vzwg6s dhAYNhzMQzwE6PptlLPARyjr9ulK7Nq9FeqaDsMmBfc1fjwqfnPTWlam4qpvw61yzNdV J0aIvXHbODRSiGV8tPnFcT7NuK0dP2W4+yoeu0JnAatDpMxtbwYPFptqhLtO/qF5MYYp k1riNdIZye6TCnftl8vKE889HO8ZbHPD7q33DVnz2c407ILOW8UdORKpc2ow+2aLB4zA N8vBanC1xCL6uJV9EBZXlp19f0TU0vEQRVttUwoDgiQMgDrybfVCND/2+E9XmLklu0EW HZkA==; 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=Rq3FhJ0h; 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 38308e7fff4ca-2f03d0bbe48si38117511fa.168.2024.07.31.12.54.21; Wed, 31 Jul 2024 12:54: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; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=Rq3FhJ0h; 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 EE48968D866; Wed, 31 Jul 2024 22:54:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 19E6D68BF43 for ; Wed, 31 Jul 2024 22:54:12 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 711C21BF204 for ; Wed, 31 Jul 2024 19:54:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1722455651; 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; bh=4qDKCiBVHro0p/CM82jK0Odgt6NfsHLXX/dgo6hhq7M=; b=Rq3FhJ0hJeVOueLRds1NT/8mpqlTI30t/GVbJc2bh8uSk4Ag4129kEvvna+hL7pM+vLBj+ cj80c2+tDxRLAO9XISdVP/sTEg+0/hyzcrgeI/JaUgL4AjK6z/Sdi67LVrlBAfCutqWPmv wGNt5JsZV1AEg8R9HLVj87Vqy6multJ1g3RjQTaF8pOT3fBoD4q8r9p6RP7fu0uHn9T++M Y/vx8Ipq2DC9FupNndVA3xP7d3F328QAKnFbbFGR7FntNhoS1qbqaSTvZEhlUqZUE/LGk3 HI0Q8ozGxd+XoL1Uk5DcD+N6pP48w8/mDqob7L4G0JKqXEDmerr1d+dAMWlttQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 31 Jul 2024 21:54:05 +0200 Message-ID: <20240731195410.274508-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/6] avcodec/cbs: sei_3d_reference_displays_info uses length 0 elements 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ngkXSwSF4xYa Fixes: 70458/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5259339779080192 Fixes: Assertion width > 0 && width <= 32 failed at libavcodec/cbs.c:608 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/cbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c index b26e39eab4d..dcbc86a5f7d 100644 --- a/libavcodec/cbs.c +++ b/libavcodec/cbs.c @@ -605,7 +605,7 @@ static av_always_inline int cbs_read_unsigned(CodedBitstreamContext *ctx, CBS_TRACE_READ_START(); - av_assert0(width > 0 && width <= 32); + av_assert0(width >= 0 && width <= 32); if (get_bits_left(gbc) < width) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid value at "