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 A353F49839 for ; Tue, 20 Feb 2024 03:42:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4EE8D68D43B; Tue, 20 Feb 2024 05:42:06 +0200 (EET) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C6BED68D3AB for ; Tue, 20 Feb 2024 05:41:59 +0200 (EET) Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6da9c834646so4505818b3a.3 for ; Mon, 19 Feb 2024 19:41:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708400516; x=1709005316; 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=YEPMYV/gNJ/G2z8Z2v60kSz1IZu6LCETfo9s/RjI++g=; b=WZcv4M3aKgWBOIOroXk2gQ9Le8n6W32zbQmbtaDG6Kpvlw07yyp6WqjiIxmdeJPAhi K58OEf0jvKy9LU77urMSIL/9yFkGeXuV2umauOtb4Oe7Gd2DrEc/gx0q1TNgsQpeCOpx Dt6wt9b7eLvQ9QdN/mEL0i7lNFwR86sgA3ZmnsNtX9K0oRk4VqtsTtSxm8jYZhDMATK0 UkmdRWwjdC2aP2CWJwwQCFFMFHgWDwk1ixm1LNWo/+9mRJycjEcaSEk6wKvcfvT0Hl43 NY7LrIxucVMonSxzvrMXZANmhONWsEqBy1ZWYaMjZPPUz9i6gB1TYQycKRGJsqi4OJ48 nz5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708400516; x=1709005316; 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=YEPMYV/gNJ/G2z8Z2v60kSz1IZu6LCETfo9s/RjI++g=; b=X+jeOzDSr6s5gisAQr+RsRoS/IieguUpydGEs9WWx9jEiA+clpJe+cf7zazw0ZPuwC HkiQmyV0AOjzOJgD1hrF9Ri+fMFhUYyWHDPMS2a8We9My6l1av6hxA3FTjPO3AUTdnSn EaqLXgumt3er4x1JkAmRQ3A5F9HtSa6OAeWV8Wpfy84+SUJyd/FG/98BgF75yFn1I0rC iCktMot5q3HWY6BX05xgv9w0D0ucg95ECw/NRCqYpIs2dAg46Ryyxvpy8TMMjQxSBLvs 6YXqOlVW8BwIycxdQluK+7ULo+1qO9ZbNnlcq6t59rSZE8mmQAMA3uiIrCwTTdhW5qdk G+dg== X-Gm-Message-State: AOJu0YwhPNSH7biCs6Gn4NOLnF5VUO1ud6lbuaAiv2TESrEpTMl+5dll THg1hOPhW7YcZcIQ8GGU3A4+/KhwSP9IDT+7ZUj4DekzMWdx97QkSzecGKKi X-Google-Smtp-Source: AGHT+IFnXvQ0CB3B/c95occsQVWaviBhqOu5oSMtX5c3E6V/T+hqopOx+F7Ib5hALDx2whD921T81g== X-Received: by 2002:a05:6a00:2e24:b0:6e1:4836:629c with SMTP id fc36-20020a056a002e2400b006e14836629cmr12811329pfb.11.1708400516093; Mon, 19 Feb 2024 19:41:56 -0800 (PST) Received: from [192.168.0.11] ([190.194.169.124]) by smtp.gmail.com with ESMTPSA id f10-20020a056a000b0a00b006dddf2ed8f0sm5611537pfu.154.2024.02.19.19.41.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Feb 2024 19:41:55 -0800 (PST) Message-ID: Date: Tue, 20 Feb 2024 00:41:57 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20240220024922.22779-1-michael@niedermayer.cc> From: James Almer In-Reply-To: <20240220024922.22779-1-michael@niedermayer.cc> Subject: Re: [FFmpeg-devel] [PATCH 1/3] tools: Add target_sws_fuzzer.c 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 2/19/2024 11:49 PM, Michael Niedermayer wrote: > +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { > + int srcW= 48, srcH = 48; > + int dstW= 48, dstH = 48; > + int srcHShift, srcVShift; > + int dstHShift, dstVShift; > + unsigned flags = 1; > + int srcStride[AV_VIDEO_MAX_PLANES] = {0}; > + int dstStride[AV_VIDEO_MAX_PLANES] = {0}; > + int ret; > + const uint8_t *end = data + size; > + enum AVPixelFormat srcFormat = AV_PIX_FMT_YUV420P; > + enum AVPixelFormat dstFormat = AV_PIX_FMT_YUV420P; > + uint8_t *src[AV_VIDEO_MAX_PLANES] = { 0 }; > + uint8_t *dst[AV_VIDEO_MAX_PLANES] = { 0 }; > + struct SwsContext *sws = NULL; > + const AVPixFmtDescriptor *desc_src, *desc_dst; > + > + if (size > 128) { > + GetByteContext gbc; > + int64_t flags64; > + > + size -= 128; > + bytestream2_init(&gbc, data + size, 128); > + srcW = bytestream2_get_le32(&gbc) % 16384; > + srcH = bytestream2_get_le32(&gbc) % 16384; > + dstW = bytestream2_get_le32(&gbc) % 16384; > + dstH = bytestream2_get_le32(&gbc) % 16384; Might as well use bytestream2_get_le16 to save bytes from the input buffer. > + > + if (srcW * (uint64_t)srcH > 16384 || dstW * (uint64_t)dstH > 16384) > + return 0; // we avoid high res as its very slow This will abort in a lot of cases. Would reading only xW then setting xH to 16384 / xW make sense? You can remove these checks if so. _______________________________________________ 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".