Fix etc__more_information__metadata_parsed__chrm

This commit is contained in:
Nigel Tao committed 2021-10-15 14:15:39 +11:00
1 parent d8ad363ef5
commit ae9ca94501
2 files changed
+16

No files matched your search

+8
View File
@@ -959,20 +959,28 @@ wuffs_base__more_information__metadata_parsed__chrm(
switch (component & 7) { switch (component & 7) {
case 0: case 0:
u = ((uint32_t)(m->x >> 0)); u = ((uint32_t)(m->x >> 0));
break;
case 1: case 1:
u = ((uint32_t)(m->x >> 24)); u = ((uint32_t)(m->x >> 24));
break;
case 2: case 2:
u = ((uint32_t)((m->x >> 48) | (m->y << 16))); u = ((uint32_t)((m->x >> 48) | (m->y << 16)));
break;
case 3: case 3:
u = ((uint32_t)(m->y >> 8)); u = ((uint32_t)(m->y >> 8));
break;
case 4: case 4:
u = ((uint32_t)(m->y >> 32)); u = ((uint32_t)(m->y >> 32));
break;
case 5: case 5:
u = ((uint32_t)((m->y >> 56) | (m->z << 8))); u = ((uint32_t)((m->y >> 56) | (m->z << 8)));
break;
case 6: case 6:
u = ((uint32_t)(m->z >> 16)); u = ((uint32_t)(m->z >> 16));
break;
case 7: case 7:
u = ((uint32_t)(m->z >> 40)); u = ((uint32_t)(m->z >> 40));
break;
} }
// The left-right shifts sign-extend from 24-bit to 32-bit integers. // The left-right shifts sign-extend from 24-bit to 32-bit integers.
return ((int32_t)(u << 8)) >> 8; return ((int32_t)(u << 8)) >> 8;
+8
View File
@@ -2595,20 +2595,28 @@ wuffs_base__more_information__metadata_parsed__chrm(
switch (component & 7) { switch (component & 7) {
case 0: case 0:
u = ((uint32_t)(m->x >> 0)); u = ((uint32_t)(m->x >> 0));
break;
case 1: case 1:
u = ((uint32_t)(m->x >> 24)); u = ((uint32_t)(m->x >> 24));
break;
case 2: case 2:
u = ((uint32_t)((m->x >> 48) | (m->y << 16))); u = ((uint32_t)((m->x >> 48) | (m->y << 16)));
break;
case 3: case 3:
u = ((uint32_t)(m->y >> 8)); u = ((uint32_t)(m->y >> 8));
break;
case 4: case 4:
u = ((uint32_t)(m->y >> 32)); u = ((uint32_t)(m->y >> 32));
break;
case 5: case 5:
u = ((uint32_t)((m->y >> 56) | (m->z << 8))); u = ((uint32_t)((m->y >> 56) | (m->z << 8)));
break;
case 6: case 6:
u = ((uint32_t)(m->z >> 16)); u = ((uint32_t)(m->z >> 16));
break;
case 7: case 7:
u = ((uint32_t)(m->z >> 40)); u = ((uint32_t)(m->z >> 40));
break;
} }
// The left-right shifts sign-extend from 24-bit to 32-bit integers. // The left-right shifts sign-extend from 24-bit to 32-bit integers.
return ((int32_t)(u << 8)) >> 8; return ((int32_t)(u << 8)) >> 8;