com php-src: Suppress shift UB in gd_itofx(): ext/gd/ libgd/gd_interpolation.c

From: Date: Wed, 19 Jun 2019 15:27:09 +0000
Subject: com php-src: Suppress shift UB in gd_itofx(): ext/gd/ libgd/gd_interpolation.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-106919@lists.php.net to get a copy of this message
Commit: 9b3b07cd26b85ff0f9c0872ef1271dfc76a2efff Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 19 Jun 2019 16:42:17 +0200 Parents: 10afeead62663e55aa2fcbcc84225bced1c998d2 Branches: PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9b3b07cd26b85ff0f9c0872ef1271dfc76a2efff Log: Suppress shift UB in gd_itofx() There doesn't seem to be a corresponding upstream fix for this. Changed paths: M ext/gd/libgd/gd_interpolation.c Diff: diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c index 357cfa4..1ac67a9 100644 --- a/ext/gd/libgd/gd_interpolation.c +++ b/ext/gd/libgd/gd_interpolation.c @@ -91,7 +91,7 @@ TODO: part of GD */ typedef long gdFixed; /* Integer to fixed point */ -#define gd_itofx(x) ((x) << 8) +#define gd_itofx(x) (long)((unsigned long)(x) << 8) /* Float to fixed point */ #define gd_ftofx(x) (long)((x) * 256) @@ -112,7 +112,7 @@ typedef long gdFixed; #define gd_mulfx(x,y) (((x) * (y)) >> 8) /* Divide a fixed by a fixed */ -#define gd_divfx(x,y) (((x) << 8) / (y)) +#define gd_divfx(x,y) ((long)((unsigned long)(x) << 8) / (y)) typedef struct {

« previous php.cvs (#106919) next »