File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -2451,22 +2451,22 @@ bool Image::is_invisible() const {
24512451 } break ;
24522452 case FORMAT_RGBAH: {
24532453 // The alpha mask accounts for the sign bit.
2454- const int pixel_count = len / 4 ;
2454+ const int pixel_count = len / 8 ;
24552455 const uint16_t *pixeldata = reinterpret_cast <const uint16_t *>(data.ptr ());
24562456
2457- for (int i = 0 ; i < pixel_count; i += 4 ) {
2458- if ((pixeldata[i + 3 ] & 0x7FFF ) != 0 ) {
2457+ for (int i = 0 ; i < pixel_count; i++ ) {
2458+ if ((pixeldata[i * 4 + 3 ] & 0x7FFF ) != 0 ) {
24592459 return false ;
24602460 }
24612461 }
24622462 } break ;
24632463 case FORMAT_RGBAF: {
24642464 // The alpha mask accounts for the sign bit.
2465- const int pixel_count = len / 4 ;
2465+ const int pixel_count = len / 16 ;
24662466 const uint32_t *pixeldata = reinterpret_cast <const uint32_t *>(data.ptr ());
24672467
2468- for (int i = 0 ; i < pixel_count; i += 4 ) {
2469- if ((pixeldata[i + 3 ] & 0x7FFFFFFF ) != 0 ) {
2468+ for (int i = 0 ; i < pixel_count; i++ ) {
2469+ if ((pixeldata[i * 4 + 3 ] & 0x7FFFFFFF ) != 0 ) {
24702470 return false ;
24712471 }
24722472 }
You can’t perform that action at this time.
0 commit comments