[Debian-med-packaging] Bug#731435: warning: iteration 55823u invokes undefined behavior [-Waggressive-loop-optimizations]

Michael R. Crusoe crusoe at debian.org
Sat Sep 14 12:01:17 BST 2024


Control: tags -1 - patch

On Mon, 6 Apr 2020 11:07:35 +0200 Alberto Garcia <berto at igalia.com> wrote:
> On Mon, Apr 06, 2020 at 10:29:35AM +0200, Mathieu Malaterre wrote:
> 
> > http://git.dcmtk.org/?p=dcmtk.git;a=commit;h=180d9b9
> 
> I have to say that I don't see how the changes to jccolor.c solve the
> problem ... the warning that we have is about this line:
> 
>      rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i;
> 
> This is round(0.58700 * 65536) * 55823 = 2147510810, which exceeds
> INT32_MAX and therefore cannot be stored in rgb_ycc_tab, no matter how
> many casts you use.

I agree, I tested the patch and the warnings remain:

/build/gdcm-3.0.24/Utilities/gdcmjpeg/jccolor.c: In function ‘rgb_ycc_start’:
/build/gdcm-3.0.24/Utilities/gdcmjpeg/jccolor.c:112:43: warning: iteration 55823 invokes undefined behavior [-Waggressive-loop-optimizations]
   112 |     rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i;
       |                                           ^
/build/gdcm-3.0.24/Utilities/gdcmjpeg/jccolor.c:110:17: note: within this loop

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/debian-med-packaging/attachments/20240914/01b5ca41/attachment.sig>


More information about the Debian-med-packaging mailing list