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 E3CE743784 for ; Tue, 28 Jun 2022 11:27:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9A35568B92B; Tue, 28 Jun 2022 14:27:04 +0300 (EEST) Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E36DB68B902 for ; Tue, 28 Jun 2022 14:26:58 +0300 (EEST) Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-fb6b4da1dfso16652573fac.4 for ; Tue, 28 Jun 2022 04:26:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=qpL4nmsNZpCWDSqYJpSLz7ugfSCMJQcqYMIx/bhNZmc=; b=gyXKjT5a9HXwl6O6avXzcMCZ8AyhSFJEK9Xvas1DAowbxzJEqsTcM3zXOQ2dsVfY8y VTKO5/EZ79JaO8kVyz9xFSc41SlJy4srgv2US1XMtHQbIXZVDXHYjwdttt4pB3+QE+eP db8Yl3ExAAvV6aNy7WhO2/ZoYtO0dIzBI5T6Z6YytJk5szHkaVUbw4k79XctSHJ196bo yLRZI5UceR+XSyQkYzV4RA5fcH4Q6ePyyN2+UIosfMXfqzsqW/8V5cduc0yOXnRClLTi YpzAjuxQ0UYIJguenFWyI32zeo3LEENK4jleRz6JTN3vB69O8PYYRqWFDek+OVnSrj8K zp3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=qpL4nmsNZpCWDSqYJpSLz7ugfSCMJQcqYMIx/bhNZmc=; b=RB7yCw/4rN4qFuF5jIKWDA7vzJmX9pA8LXBAsTgu+Bq7qxk1k8cOo6tL/rRiSq8lpA 8mbdW+GZh0gpLSRAiW5UH7z5yeyAbri6CKgXMcsqs/ZWSXVnf/G/lxTJTWbva9pgAE/d ppsdLGPZAIxLN00cYHpaEFVqNlvQYO8vdquq7sdVPf8WnwF7dNnFSB22LixmpFdzXKd3 EG3VbRIi2L28SJrn/y/tXPJKcy3GPfyM5prm0ripb1D4qWa0iz3ad/105hExpjlW3qjf 7l74f2AH+8ndhC0AbuA6lRFnhUkyvmPElhm8cyALJQisrTdxyReDh8MKluu8uGL9dWfS bnNg== X-Gm-Message-State: AJIora8wemg8aikomzIFR1teu6+VjS5ZhNmdZeOZt9S9P4j3d7ThjeqW VbHBwRn2YEnhMcl8jUeiUSNh0L3GM0s= X-Google-Smtp-Source: AGRyM1te1z4OW9rf5O1AIGC8XfAhE/U1RIhvNQP1lh6jsXX3sHgYphlJRXtalrVDHj4vVk8XbIjmAg== X-Received: by 2002:a05:6870:b254:b0:ec:6ca4:c89f with SMTP id b20-20020a056870b25400b000ec6ca4c89fmr13663150oam.272.1656415615884; Tue, 28 Jun 2022 04:26:55 -0700 (PDT) Received: from [192.168.0.13] ([186.136.131.204]) by smtp.gmail.com with ESMTPSA id 44-20020a9d032f000000b006169f5547e0sm7751081otv.30.2022.06.28.04.26.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Jun 2022 04:26:54 -0700 (PDT) Message-ID: <5868ba10-3131-7a10-da47-e586a7234857@gmail.com> Date: Tue, 28 Jun 2022 08:26:54 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220627084347.30362-1-michael@niedermayer.cc> <165639370846.12703.18353942820053902051@lain.khirnov.net> From: James Almer In-Reply-To: <165639370846.12703.18353942820053902051@lain.khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH] avformat/aaxdec: Check for empty segments 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 6/28/2022 2:21 AM, Anton Khirnov wrote: > Quoting Michael Niedermayer (2022-06-27 10:43:47) >> Fixes: Timeout >> Fixes: 48154/clusterfuzz-testcase-minimized-ffmpeg_dem_AAX_fuzzer-5149094353436672 >> >> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg >> Signed-off-by: Michael Niedermayer >> --- >> libavformat/aaxdec.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/libavformat/aaxdec.c b/libavformat/aaxdec.c >> index dd1fbde736..bcbff216db 100644 >> --- a/libavformat/aaxdec.c >> +++ b/libavformat/aaxdec.c >> @@ -252,6 +252,8 @@ static int aax_read_header(AVFormatContext *s) >> size = avio_rb32(pb); >> a->segments[r].start = start + a->data_offset; >> a->segments[r].end = a->segments[r].start + size; >> + if (!size) >> + return AVERROR_INVALIDDATA; > > Why check for invalid size only after some things are set based on it > and not before? Also, if the problem is that a->segments[r].start == a->segments[r].end, then maybe it'd be better, or at least more clear to the reader, to ensure that as part of the checks immediately after this line. _______________________________________________ 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".