diff options
Diffstat (limited to 'meta/recipes-multimedia/libtiff/files/CVE-2022-0865.patch')
-rw-r--r-- | meta/recipes-multimedia/libtiff/files/CVE-2022-0865.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/libtiff/files/CVE-2022-0865.patch b/meta/recipes-multimedia/libtiff/files/CVE-2022-0865.patch new file mode 100644 index 0000000000..e2d136f587 --- /dev/null +++ b/meta/recipes-multimedia/libtiff/files/CVE-2022-0865.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From a1c933dabd0e1c54a412f3f84ae0aa58115c6067 Mon Sep 17 00:00:00 2001 | ||
2 | From: Even Rouault <even.rouault@spatialys.com> | ||
3 | Date: Thu, 24 Feb 2022 22:26:02 +0100 | ||
4 | Subject: [PATCH] tif_jbig.c: fix crash when reading a file with multiple IFD | ||
5 | in memory-mapped mode and when bit reversal is needed (fixes #385) | ||
6 | |||
7 | CVE: CVE-2022-0865 | ||
8 | Upstream-Status: Backport [https://sources.debian.org/src/tiff/4.1.0+git191117-2%7Edeb10u4/debian/patches/CVE-2022-0865.patch/] | ||
9 | Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com> | ||
10 | Comment: No change in any hunk | ||
11 | |||
12 | --- | ||
13 | libtiff/tif_jbig.c | 10 ++++++++++ | ||
14 | 1 file changed, 10 insertions(+) | ||
15 | |||
16 | diff --git a/libtiff/tif_jbig.c b/libtiff/tif_jbig.c | ||
17 | index 74086338..8bfa4cef 100644 | ||
18 | --- a/libtiff/tif_jbig.c | ||
19 | +++ b/libtiff/tif_jbig.c | ||
20 | @@ -208,6 +208,16 @@ int TIFFInitJBIG(TIFF* tif, int scheme) | ||
21 | */ | ||
22 | tif->tif_flags |= TIFF_NOBITREV; | ||
23 | tif->tif_flags &= ~TIFF_MAPPED; | ||
24 | + /* We may have read from a previous IFD and thus set TIFF_BUFFERMMAP and | ||
25 | + * cleared TIFF_MYBUFFER. It is necessary to restore them to their initial | ||
26 | + * value to be consistent with the state of a non-memory mapped file. | ||
27 | + */ | ||
28 | + if (tif->tif_flags&TIFF_BUFFERMMAP) { | ||
29 | + tif->tif_rawdata = NULL; | ||
30 | + tif->tif_rawdatasize = 0; | ||
31 | + tif->tif_flags &= ~TIFF_BUFFERMMAP; | ||
32 | + tif->tif_flags |= TIFF_MYBUFFER; | ||
33 | + } | ||
34 | |||
35 | /* Setup the function pointers for encode, decode, and cleanup. */ | ||
36 | tif->tif_setupdecode = JBIGSetupDecode; | ||
37 | -- | ||
38 | GitLab | ||
39 | |||