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 8CDF448F0B for ; Tue, 30 Jan 2024 06:26:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8CF8768D244; Tue, 30 Jan 2024 08:26:46 +0200 (EET) Received: from mail-vs1-f49.google.com (mail-vs1-f49.google.com [209.85.217.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9BBC068D1E1 for ; Tue, 30 Jan 2024 08:26:40 +0200 (EET) Received: by mail-vs1-f49.google.com with SMTP id ada2fe7eead31-46b1f0ff2ccso902749137.3 for ; Mon, 29 Jan 2024 22:26:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706595998; x=1707200798; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jKx+wLwDzHy8f5t7NY5ixaFhe79YmHxrQ/OTTG/OBl4=; b=a5ydgoNiyTIqR7eHsdTM0w/IA04C5rM8OooqUUPUeW1V/3WQ6lcUk6vQRU5DErRCgB On5NyZAUGwXOz4LfcGKiZ5xV3eXvQB9NFRi8PdAYa7ACmRnyK0aPLWi27wHMfw1RlFIq WvFuvAgCRtIl1tYtoUdQzrZu3h4hdGr2uGFzapQx7Gcus6XycMZv2EITIiO9+3RBdJrr A0hvk026oqgnp/RaPOESpd5+LuSARbj/0gyRAyJyb43QHT2c6SRr2qaFvFdibZRMqq9U MZFSc9pw0Eva32xe2FIJCgyYAmndaoHnv7VRfOoXX6UA4hHm2DAcqENQvmYzW9p0d6qC +hZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706595998; x=1707200798; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jKx+wLwDzHy8f5t7NY5ixaFhe79YmHxrQ/OTTG/OBl4=; b=bApqJ9fn/Hk0r/TlGn2KsuEfjzcLnjfhpJb2UiLKKzP9hxzi2NindBLvLn3Rer/sRZ FWlYWqJZi6vM4Zjb2odw1HZ4achUL6CnhfB2hGAHbTwnNnHZhdTuLH18RhsWxMXH3rG3 IQN0DY/hQ26yCg/LDqrh3CY4L6WwijgM9zhDlnRsrbuGPx+4/dVW/F6hdGvy8lGDYZk8 CmnEwOAWqwXLBoMt8at+keB2cAXrsjafUZzXIOQ+8gStbbF3vjXaFIcgUwRNjf42uAFS Ga1Yg1/8CT8lI5YD+fId1O5LQ/Lw2s/YjCG0XWVBC5Wir8lkQoYNu1qG9SFEW7bFAAkQ Ak2A== X-Gm-Message-State: AOJu0YyYo9uEqQmiX4IAnEB8XVwspI0p6Fkrzp8XB2vdzl7cEBPFcbcW D21/xV85pNse1BY6cqR6ckRbVMombgMayJk/qbbK5Kzb/DNWRgETqqqs65UMujI= X-Google-Smtp-Source: AGHT+IGIpLL84LQV2qeyfbJRAxXw1YsIPpnGJNRDP88ml61BTdPBQz2J9Is+ej7T9Uoqwso5exLnSQ== X-Received: by 2002:a05:6102:41a0:b0:467:fb8c:6ee5 with SMTP id cd32-20020a05610241a000b00467fb8c6ee5mr4202609vsb.49.1706595998164; Mon, 29 Jan 2024 22:26:38 -0800 (PST) Received: from localhost ([2601:647:4600:84e0:cd8b:a23d:3457:1538]) by smtp.gmail.com with UTF8SMTPSA id pt3-20020a17090b3d0300b0028e023be116sm483152pjb.49.2024.01.29.22.26.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Jan 2024 22:26:37 -0800 (PST) From: Connor Worley To: ffmpeg-devel@ffmpeg.org Date: Mon, 29 Jan 2024 22:26:26 -0800 Message-Id: <20240130062626.98273-1-connorbworley@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] lavc/dxv: fix incorrect back-reference index calculation in DXT5 decoding 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 Cc: Connor Worley Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: This bug causes the DXT5 decoder to produce incorrect block texture data. After the fix, textures are visually correct and match data decoded by Resolume Alley (extracted with Nvida Nsight for comparison). Current FATE DXT5 samples did not cover this case. Signed-off-by: Connor Worley --- libavcodec/dxv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index b29adf8ad9..be1216da86 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -755,7 +755,7 @@ static int dxv_decompress_dxt5(AVCodecContext *avctx) break; case 2: /* Copy two dwords from a previous index */ - idx = 8 + bytestream2_get_le16(gbc); + idx = 8 + 4 * bytestream2_get_le16(gbc); if (idx > pos || (unsigned int)(pos - idx) + 2 > ctx->tex_size / 4) return AVERROR_INVALIDDATA; prev = AV_RL32(ctx->tex_data + 4 * (pos - idx)); -- 2.40.1 _______________________________________________ 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".