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 517E14778C for ; Sun, 22 Oct 2023 14:34:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A6B6568C9CC; Sun, 22 Oct 2023 17:34:14 +0300 (EEST) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6DA7A68C6E0 for ; Sun, 22 Oct 2023 17:34:08 +0300 (EEST) Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-32dd70c5401so1696151f8f.0 for ; Sun, 22 Oct 2023 07:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20230601.gappssmtp.com; s=20230601; t=1697985248; x=1698590048; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=UPg4zWYhlLPyj7vJsxxtyL9DaiAxmxULgQL0yf5udu8=; b=KWOvO5yi2YF2fOZHoCaF66CuoR30aeQTylM/Wh1ViQ5OuW0ncLXf43zsOo1Di6rtCn xti18PZyJfBCnTfQ8wDTa4/YZAwrk5zNcrfqXdU8q5K8ecWmYRNxipbRH6GTIZgiHavM tuQQuFgnld0A+bPWBTowUV/3D/HLi3BYgGzjNhGHWjK6sRz38qovjz2gSOAG89Wf2nG3 KfbwR+DkD8CRn99ESgqKDNFfdcnWrJfsgBVC9XCrG1m+32TFMTvOP1JBvbKoK0ryURhc KUjpa0z9MH3gUt1MlYQo10Bhls146gLt9mw25m7V2CpA/+hAm5LScyKlK95ilxnVDZcY HF1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697985248; x=1698590048; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UPg4zWYhlLPyj7vJsxxtyL9DaiAxmxULgQL0yf5udu8=; b=kfU8LGqD5E12l5AQA7VpZlt99jwXneH0jhVaIYD0fAAhAut+1mnqXXLCMsXlMCyamp OhaUmwN3emVE3DEsSo4l0kk+XkB/nomSQEMVBcFFbZj8JdC6spAr0TLx2xa6tz8kWt5/ EMBGY8zyPQ3+SeSHjblqwUEpI6xmXi+aZWJUUaxOPAkH6MPbMuEOqneZTuWHy6Fz9enA sDZJftDlSeT5S1AhCbcYgh0m3majMJl6e+kMknRXHiqdyWondEbZoW6xrlj0vejHEyzm cYbdgHLj7stwe+Cc/JgORnk7f/jKT/mBFlSltYtp1hRzvWpxOR4+wXVx4qkIYC+bJ42k 0Cug== X-Gm-Message-State: AOJu0Yxf5Mjch3zlRxlWtkwF2ywJmPXCMfbEq54pHF6Q4SyybF7XKtnn TVoUj9xiatgJ/s9PTFTv1xyeA0JwlIFhnQbacUc= X-Google-Smtp-Source: AGHT+IHUbJ5yuhAFX2dPuv69uK5qkg7878BY/pNqyHwfXYK5zhpk2ESQNC/u8rJVbVZt65j+6PycNw== X-Received: by 2002:a05:6000:bc9:b0:32d:b2cf:8ccd with SMTP id dm9-20020a0560000bc900b0032db2cf8ccdmr4572795wrb.47.1697985247341; Sun, 22 Oct 2023 07:34:07 -0700 (PDT) Received: from [192.168.0.15] (cpc92320-cmbg19-2-0-cust383.5-4.cable.virginm.net. [82.13.65.128]) by smtp.gmail.com with ESMTPSA id k13-20020a5d628d000000b0032daf848f68sm5750066wru.59.2023.10.22.07.34.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Oct 2023 07:34:07 -0700 (PDT) Message-ID: Date: Sun, 22 Oct 2023 15:34:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20231022003520.17154-1-michael@niedermayer.cc> <20231022003520.17154-2-michael@niedermayer.cc> From: Mark Thompson In-Reply-To: <20231022003520.17154-2-michael@niedermayer.cc> Subject: Re: [FFmpeg-devel] [PATCH 2/6] avcodec/cbs: Do not assert on traces beyond 255 bits 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 22/10/2023 01:35, Michael Niedermayer wrote: > Fixes: Assertion length < 256 failed at libavcodec/cbs.c:517 > Fixes: 62673/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-6490971837431808 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/cbs.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c > index cdd7adebebd..2f5d0334a2a 100644 > --- a/libavcodec/cbs.c > +++ b/libavcodec/cbs.c > @@ -514,6 +514,11 @@ void ff_cbs_trace_read_log(void *trace_context, > > position = get_bits_count(gbc); > > + if (length >= 256) { > + av_log(ctx->log_ctx, ctx->trace_level, "trace of %d bits truncated at 255\n", length); > + length = 255; > + } > + > av_assert0(length < 256); > for (i = 0; i < length; i++) > bits[i] = get_bits1(gbc) ? '1' : '0'; IMO the assert is sensible (no syntax element is that large) and so this must be catching a bug somewhere else. Please don't nullify the assert to hide the bug. Can you share the input stream which hit this case? Thanks, - Mark _______________________________________________ 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".