aboutsummaryrefslogtreecommitdiffstats
path: root/main/giflib/CVE-2022-28506.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/giflib/CVE-2022-28506.patch')
-rw-r--r--main/giflib/CVE-2022-28506.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/main/giflib/CVE-2022-28506.patch b/main/giflib/CVE-2022-28506.patch
new file mode 100644
index 00000000000..7dbd669487d
--- /dev/null
+++ b/main/giflib/CVE-2022-28506.patch
@@ -0,0 +1,15 @@
+https://sourceforge.net/p/giflib/code/merge-requests/12/
+--- a/gif2rgb.c
++++ b/gif2rgb.c
+@@ -294,6 +294,11 @@ static void DumpScreen2RGB(char *FileNam
+ GifRow = ScreenBuffer[i];
+ GifQprintf("\b\b\b\b%-4d", ScreenHeight - i);
+ for (j = 0, BufferP = Buffer; j < ScreenWidth; j++) {
++ /* Check if color is within color palete */
++ if (GifRow[j] >= ColorMap->ColorCount)
++ {
++ GIF_EXIT(GifErrorString(D_GIF_ERR_IMAGE_DEFECT));
++ }
+ ColorMapEntry = &ColorMap->Colors[GifRow[j]];
+ *BufferP++ = ColorMapEntry->Red;
+ *BufferP++ = ColorMapEntry->Green;