… | |
… | |
469 | if (data[10] & 0x80) |
469 | if (data[10] & 0x80) |
470 | ofs += (1 << ((data[10] & 7) + 1)) * 3; |
470 | ofs += (1 << ((data[10] & 7) + 1)) * 3; |
471 | |
471 | |
472 | if (data_len >= ofs + 2 + 1 + 11) |
472 | if (data_len >= ofs + 2 + 1 + 11) |
473 | { |
473 | { |
|
|
474 | |
474 | // skip a rare first graphic control extension block |
475 | // skip a graphic control extension block. we assume |
475 | // we assume there is exactly one block |
476 | // there is at most one such block - while the NAB |
|
|
477 | // has to come firstz, some files do not obey this |
476 | if (data[ofs] == 0x21 && data[ofs + 1] == 0xf9) |
478 | if (data[ofs] == 0x21 && data[ofs + 1] == 0xf9) |
477 | ofs += 3 + data[ofs + 2] + 1; |
479 | ofs += 3 + data[ofs + 2] + 1; |
478 | |
480 | |
479 | if (data_len >= ofs + 2 + 1 + 11) |
481 | if (data_len >= ofs + 2 + 1 + 11) |
480 | if (!memcmp (data + ofs, "\x21\xff\x0bNETSCAPE2.0", sizeof ("\x21\xff\x0bNETSCAPE2.0") - 1)) |
482 | if (!memcmp (data + ofs, "\x21\xff\x0bNETSCAPE2.0", sizeof ("\x21\xff\x0bNETSCAPE2.0") - 1)) |