@@ -490,8 +490,9 @@ getpixel(Imaging im, ImagingAccess access, int x, int y)
490490 case IMAGING_TYPE_FLOAT32 :
491491 return PyFloat_FromDouble (pixel .f );
492492 case IMAGING_TYPE_SPECIAL :
493- if (strncmp (im -> mode , "I;16" , 4 ) == 0 )
493+ if (strncmp (im -> mode , "I;16" , 4 ) == 0 ) {
494494 return PyLong_FromLong (pixel .h );
495+ }
495496 break ;
496497 }
497498
@@ -1456,8 +1457,9 @@ _point(ImagingObject* self, PyObject* args)
14561457 lut [i * 4 ] = CLIP8 (data [i ]);
14571458 lut [i * 4 + 1 ] = CLIP8 (data [i + 256 ]);
14581459 lut [i * 4 + 2 ] = CLIP8 (data [i + 512 ]);
1459- if (n > 768 )
1460+ if (n > 768 ) {
14601461 lut [i * 4 + 3 ] = CLIP8 (data [i + 768 ]);
1462+ }
14611463 }
14621464 im = ImagingPoint (self -> image , mode , (void * ) lut );
14631465 } else {
@@ -1523,16 +1525,18 @@ _putdata(ImagingObject* self, PyObject* args)
15231525 /* Plain string data */
15241526 for (i = y = 0 ; i < n ; i += image -> xsize , y ++ ) {
15251527 x = n - i ;
1526- if (x > (int ) image -> xsize )
1528+ if (x > (int ) image -> xsize ) {
15271529 x = image -> xsize ;
1530+ }
15281531 memcpy (image -> image8 [y ], p + i , x );
15291532 }
15301533 } else {
15311534 /* Scaled and clipped string data */
15321535 for (i = x = y = 0 ; i < n ; i ++ ) {
15331536 image -> image8 [y ][x ] = CLIP8 ((int ) (p [i ] * scale + offset ));
1534- if (++ x >= (int ) image -> xsize )
1537+ if (++ x >= (int ) image -> xsize ) {
15351538 x = 0 , y ++ ;
1539+ }
15361540 }
15371541 }
15381542 } else {
@@ -1932,12 +1936,14 @@ im_setmode(ImagingObject* self, PyObject* args)
19321936 /* color to color */
19331937 strcpy (im -> mode , mode );
19341938 im -> bands = modelen ;
1935- if (!strcmp (mode , "RGBA" ))
1939+ if (!strcmp (mode , "RGBA" )) {
19361940 (void ) ImagingFillBand (im , 3 , 255 );
1941+ }
19371942 } else {
19381943 /* trying doing an in-place conversion */
1939- if (!ImagingConvertInPlace (im , mode ))
1944+ if (!ImagingConvertInPlace (im , mode )) {
19401945 return NULL ;
1946+ }
19411947 }
19421948
19431949 if (self -> access ) {
0 commit comments