Skip to content
Snippets Groups Projects
Commit a26e89e1 authored by GitLab Release Tools Bot's avatar GitLab Release Tools Bot
Browse files

Merge branch 'security-graphicsmagick-update-backport-13-4' into '13-4-stable'

Update GraphicsMagick to 1.3.35 and patch PNG vulnerability

See merge request gitlab-org/security/omnibus-gitlab!63
parents a73fe0c3 bacbcc60
No related branches found
No related tags found
No related merge requests found
---
title: Update GraphicsMagick to 1.3.35 and patch PNG vulnerability
merge_request:
author:
type: security
Patch adapted from https://sourceforge.net/p/graphicsmagick/code/ci/50395430a37188d0d197e71bd85ed6dd0f649ee3/.
diff --git a/coders/png.c b/coders/png.c
index 60ce8dc..5878e60 100644
--- a/coders/png.c
+++ b/coders/png.c
@@ -5304,7 +5304,7 @@ static Image *ReadMNGImage(const ImageInfo *image_info,
if (logging)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
"MAGN chunk (%lu bytes): "
- "First_magnified_object_id=%u, Last_magnified_object_id=%u, "
+ "First_magnified_object_id=%u, Las t_magnified_object_id=%u, "
"MB=%u, ML=%u, MR=%u, MT=%u, MX=%u, MY=%u, "
"X_method=%u, Y_method=%u",
length,
@@ -5679,6 +5679,8 @@ static Image *ReadMNGImage(const ImageInfo *image_info,
/*
If magnifying and a supported method is requested then
magnify the image.
+
+ http://www.libpng.org/pub/mng/spec/mng-1.0-20010209-pdg.html#mng-MAGN
*/
if (((mng_info->magn_methx > 0) && (mng_info->magn_methx <= 5)) &&
((mng_info->magn_methy > 0) && (mng_info->magn_methy <= 5)))
@@ -5689,7 +5691,28 @@ static Image *ReadMNGImage(const ImageInfo *image_info,
if (logging)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " Processing MNG MAGN chunk");
+ " Processing MNG MAGN chunk: MB=%u, ML=%u,"
+ " MR=%u, MT=%u, MX=%u, MY=%u,"
+ " X_method=%u, Y_method=%u",
+ mng_info->magn_mb,mng_info->magn_ml,
+ mng_info->magn_mr,mng_info->magn_mt,
+ mng_info->magn_mx,mng_info->magn_my,
+ mng_info->magn_methx,
+ mng_info->magn_methy);
+
+ /*
+ If the image width is 1, then X magnification is done
+ by simple pixel replication.
+ */
+ if (image->columns == 1)
+ mng_info->magn_methx = 1;
+
+ /*
+ If the image height is 1, then Y magnification is done
+ by simple pixel replication.
+ */
+ if (image->rows == 1)
+ mng_info->magn_methy = 1;
if (mng_info->magn_methx == 1)
{
@@ -5734,12 +5757,10 @@ static Image *ReadMNGImage(const ImageInfo *image_info,
Image
*large_image;
- int
- yy;
-
long
m,
- y;
+ y,
+ yy;
register long
x;
Loading
Loading
@@ -15,7 +15,7 @@
#
 
name 'graphicsmagick'
default_version '1.3.34'
default_version '1.3.35'
 
license 'MIT'
license_file 'Copyright.txt'
Loading
Loading
@@ -28,13 +28,15 @@ dependency 'libtiff'
dependency 'zlib'
 
source url: "https://ftp.icm.edu.pl/pub/unix/graphics/GraphicsMagick/1.3/GraphicsMagick-#{version}.tar.gz",
sha256: '4717f7a32d964c515d83706fd52d34e089c2ffa35f8fbf43c923ce19343cf2f4'
sha256: 'd96d5ce2ef7e0e90166551e38742713728bfd33d6f18495a9ddda938700fc055'
 
relative_path "GraphicsMagick-#{version}"
 
build do
env = with_standard_compiler_flags(with_embedded_path)
 
patch source: "png-vulnerability-fix.patch"
configure_command = [
'./configure',
"--prefix=#{install_dir}/embedded",
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment