@@ -1457,28 +1457,29 @@ static signed short php_ifd_get16s(void *value, int motorola_intel)
1457
1457
/* }}} */
1458
1458
1459
1459
/* {{{ php_ifd_get32s
1460
- * Convert a 32 bit signed value from file's native byte order */
1461
- static int php_ifd_get32s (void * value , int motorola_intel )
1460
+ * Convert a 32 bit unsigned value from file's native byte order */
1461
+ static unsigned php_ifd_get32u (void * void_value , int motorola_intel )
1462
1462
{
1463
+ uchar * value = (uchar * ) void_value ;
1463
1464
if (motorola_intel ) {
1464
- return ((( char * )value ) [0 ] << 24 )
1465
- | ((( uchar * )value ) [1 ] << 16 )
1466
- | ((( uchar * )value ) [2 ] << 8 )
1467
- | ((( uchar * )value ) [3 ] );
1465
+ return ((unsigned )value [0 ] << 24 )
1466
+ | ((unsigned )value [1 ] << 16 )
1467
+ | ((unsigned )value [2 ] << 8 )
1468
+ | ((unsigned )value [3 ] );
1468
1469
} else {
1469
- return ((( char * )value ) [3 ] << 24 )
1470
- | ((( uchar * )value ) [2 ] << 16 )
1471
- | ((( uchar * )value ) [1 ] << 8 )
1472
- | ((( uchar * )value ) [0 ] );
1470
+ return ((unsigned )value [3 ] << 24 )
1471
+ | ((unsigned )value [2 ] << 16 )
1472
+ | ((unsigned )value [1 ] << 8 )
1473
+ | ((unsigned )value [0 ] );
1473
1474
}
1474
1475
}
1475
1476
/* }}} */
1476
1477
1477
1478
/* {{{ php_ifd_get32u
1478
- * Write 32 bit unsigned value to data */
1479
- static unsigned php_ifd_get32u (void * value , int motorola_intel )
1479
+ * Convert a 32 bit signed value from file's native byte order */
1480
+ static unsigned php_ifd_get32s (void * value , int motorola_intel )
1480
1481
{
1481
- return (unsigned ) php_ifd_get32s (value , motorola_intel ) & 0xffffffff ;
1482
+ return (int ) php_ifd_get32u (value , motorola_intel );
1482
1483
}
1483
1484
/* }}} */
1484
1485
0 commit comments