aboutsummaryrefslogtreecommitdiffstats
path: root/main/openjpeg/CVE-2017-12982.patch
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2017-08-23 09:51:25 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2017-08-23 10:00:32 +0000
commit46b2f52fae679185e9d21306e7c3ae07197d1425 (patch)
tree79ede179ffacecb46d8a5e4664ebebf33054350e /main/openjpeg/CVE-2017-12982.patch
parent02dbd8c295772ce0004692ce03757de470e16af4 (diff)
downloadaports-46b2f52fae679185e9d21306e7c3ae07197d1425.tar.bz2
aports-46b2f52fae679185e9d21306e7c3ae07197d1425.tar.xz
main/openjpeg: security fix for CVE-2017-12982. Fixes #7712
Diffstat (limited to 'main/openjpeg/CVE-2017-12982.patch')
-rw-r--r--main/openjpeg/CVE-2017-12982.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/main/openjpeg/CVE-2017-12982.patch b/main/openjpeg/CVE-2017-12982.patch
new file mode 100644
index 0000000000..724cf602d1
--- /dev/null
+++ b/main/openjpeg/CVE-2017-12982.patch
@@ -0,0 +1,25 @@
+From baf0c1ad4572daa89caa3b12985bdd93530f0dd7 Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault@spatialys.com>
+Date: Mon, 14 Aug 2017 17:26:58 +0200
+Subject: [PATCH] bmp_read_info_header(): reject bmp files with biBitCount == 0
+ (#983)
+
+---
+ src/bin/jp2/convertbmp.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/bin/jp2/convertbmp.c b/src/bin/jp2/convertbmp.c
+index b49e7a080..2715fdf24 100644
+--- a/src/bin/jp2/convertbmp.c
++++ b/src/bin/jp2/convertbmp.c
+@@ -392,6 +392,10 @@ static OPJ_BOOL bmp_read_info_header(FILE* IN, OPJ_BITMAPINFOHEADER* header)
+
+ header->biBitCount = (OPJ_UINT16)getc(IN);
+ header->biBitCount |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
++ if (header->biBitCount == 0) {
++ fprintf(stderr, "Error, invalid biBitCount %d\n", 0);
++ return OPJ_FALSE;
++ }
+
+ if (header->biSize >= 40U) {
+ header->biCompression = (OPJ_UINT32)getc(IN);