From 254589efb50a65e6e1fc575ceb8c25ee604111fd Mon Sep 17 00:00:00 2001
From: Andreas Nedbal <andy@pixelde.su>
Date: Wed, 20 Sep 2023 22:39:06 +0200
Subject: [PATCH] [BUGFIX] Add more inputs for GifBuilder hash uniqueness
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The previous hashing inputs didn't include the X/Y coordinates
or the calculated offsets, so similarly configured GIFBUILDERs
had a high likelyhood of loading older images.

Adding more inputs, but not falling back to fully encoding all
of $this->setup should keep the performance and increase
uniqueness.

Resolves: #94648
Releases: main, 12.4
Change-Id: Id396f3df34b64317a2ac394d85660b1e8516294a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81118
Tested-by: Andreas Nedbal <andy@pixelde.su>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Andreas Nedbal <andy@pixelde.su>
Tested-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
---
 typo3/sysext/frontend/Classes/Imaging/GifBuilder.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php b/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php
index 0a3b60fa017a..c98f695a760e 100644
--- a/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php
+++ b/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php
@@ -1390,8 +1390,10 @@ class GifBuilder
             array_keys($this->setup),
             $filePrefix,
             $this->im,
+            $this->XY,
             $this->w,
             $this->h,
+            $this->OFFSET,
             $this->workArea,
             $this->combinedTextStrings,
             $this->combinedFileNames,
-- 
GitLab