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 F1B3749AA6 for ; Tue, 27 Feb 2024 18:46:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EDF4F68CD22; Tue, 27 Feb 2024 20:46:00 +0200 (EET) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D3C1B68CC0B for ; Tue, 27 Feb 2024 20:45:54 +0200 (EET) Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-53fa455cd94so3448379a12.2 for ; Tue, 27 Feb 2024 10:45:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709059552; x=1709664352; 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=ZhRGIutcDCiw+1TlFusGZqo0FtRdB/BOx72LkUVufoY=; b=ArTYWdjLWI+lj5jVQVHshLpkeW+Aw7tiXBKJoXSrkJEPWKwi1aHsIbe2cZ1JaqggoY HVQOLnkAdwxI+PuQvGQoROQylr5yHNPlj2OCOZPO0rkpMNea5TGNL/V+gwM6OHq2SsqQ 11QDH5BOaey/3F9LCwYNha4t19YOpwYcuwZdRBmnLoawBOpK9+KmxnUWpqKFaCQCDjKX K3WyhgIVT5QEmF+doHUniJ4IXgwr5TJtYBZplpRv0SovYhykw8dRjl6I245CP/kQfU61 RBs/2CQySqynY5de1IW9cPmKAAZ9vcY2WrIt1wHCbu/hymOSfC4yc8gYQmX62amIMUKn Q4RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709059552; x=1709664352; 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=ZhRGIutcDCiw+1TlFusGZqo0FtRdB/BOx72LkUVufoY=; b=fmn+wj5B9nsTAizFHsgBIByoOtF8W3dj2jGXrDG2uwLjJXLSpM6PYWEEwvZLhLkZyN rP3Kd1oZ31PttuBJwP9h9QZtzDE4UQvNr+BnhxOCzGlgRbqyw49x9mDKbgZIYC9K1QNN Xmg3EsliEvQA8nupM4GhFBMud5/aJ8LHpIQaCWBa/w9hhOIiyyTNRcQ5mqazw+Qk1+mO aOEFby6hHnQ//bo8Ryqg+FVyxAogDB8ItcI4FNV4cQvFCiogeHqEeVqXE5cePmz/KzV4 QQ+gxrOCBbdy8q70PkRJ9SMs6VrbGPXYx4rzaagH7U25V6BTyKtMj56RqLJiNmBgvP+D ZmRQ== X-Gm-Message-State: AOJu0YxJN14ULeYwy2ORCzDhoCW+E/W0wLQNZj89gdK9KT6O7ilkYuys 1HnLChKcaTqT439ewqQX+w0HnME8FMGPDaWXKMzaJvXnEUjL2ZCfTT3GWeUW X-Google-Smtp-Source: AGHT+IH8wMR8glap6LcWRtdNQ3lh/pXwvcnlaECszCU+8r4p8IK6eQV2sRFsNwqibYC0FrMPF7U/Sw== X-Received: by 2002:a17:90a:3484:b0:299:3e54:83f6 with SMTP id p4-20020a17090a348400b002993e5483f6mr8204760pjb.7.1709059551643; Tue, 27 Feb 2024 10:45:51 -0800 (PST) Received: from [192.168.0.11] ([190.194.169.124]) by smtp.gmail.com with ESMTPSA id sx7-20020a17090b2cc700b00299404af11csm8774281pjb.36.2024.02.27.10.45.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Feb 2024 10:45:51 -0800 (PST) Message-ID: Date: Tue, 27 Feb 2024 15:45:48 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] avcodec/dxvenc: Use proper alignment, write endian-independent output 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/26/2024 8:50 PM, Andreas Rheinhardt wrote: > Fixes the dxv3enc-dxt1 FATE test with UBSan. > > Signed-off-by: Andreas Rheinhardt > --- > I have not actually tested whether the output is actually wrong > on BE systems. Would be nice if someone could. > > libavcodec/dxvenc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/dxvenc.c b/libavcodec/dxvenc.c > index 1ce2b1d014..3f28fb696a 100644 > --- a/libavcodec/dxvenc.c > +++ b/libavcodec/dxvenc.c > @@ -149,7 +149,7 @@ typedef struct DXVEncContext { > } else { \ > op = 0; \ > } \ > - *value |= (op << (state * 2)); \ > + AV_WL32(value, AV_RL32(value) | (op << (state * 2))); \ > state++; \ > } while (0) > > @@ -157,7 +157,7 @@ static int dxv_compress_dxt1(AVCodecContext *avctx) > { > DXVEncContext *ctx = avctx->priv_data; > PutByteContext *pbc = &ctx->pbc; > - uint32_t *value; > + void *value; You should probably also remove the uint32_t* cast in the above macro. > uint32_t color, lut, idx, color_idx, lut_idx, prev_pos, state = 16, pos = 2, op = 0; > > ht_init(ctx->color_lookback_ht); _______________________________________________ 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".