Put the GIF frame_config I/O position back 1 byte

We'll need that flags byte (for the interlace bit and palette size) when
decoding frames in a random-access manner.
This commit is contained in:
Nigel Tao committed 2018-08-26 17:48:43 +10:00
1 parent 0066d6ac9b
commit 695d731fb9
3 files changed
+88 -96

No files matched your search

+4 -4
View File
@@ -844,7 +844,7 @@ bool do_test_wuffs_gif_io_position(bool chunked) {
return false;
}
uint64_t wants[4] = {818, 2144, 2205, 2560};
uint64_t wants[4] = {817, 2143, 2204, 2559};
int i;
for (i = 0; i < 4; i++) {
wuffs_base__frame_config fc = ((wuffs_base__frame_config){});
@@ -860,13 +860,13 @@ bool do_test_wuffs_gif_io_position(bool chunked) {
return false;
}
// Look for the 0x2C byte that's the start of a GIF's Image Descriptor, 10
// Look for the 0x2C byte that's the start of a GIF's Image Descriptor, 9
// bytes before the frame_config's I/O position.
if ((got < 10) || (got - 10 < src.pos)) {
if ((got < 9) || (got - 9 < src.pos)) {
FAIL("io_position #%d: got %" PRIu64 ", was too small", i, got);
return false;
}
uint64_t index = got - 10 - src.pos;
uint64_t index = got - 9 - src.pos;
if (index >= src.wi) {
FAIL("io_position #%d: got %" PRIu64 ", was too large", i, got);
return false;