Write the length field for the chunk and insert pad byte if the chunk is odd-sized.
| 409 | // Write the length field for the chunk and insert |
| 410 | // pad byte if the chunk is odd-sized. |
| 411 | void FinishChunk (uint8_t **stream) |
| 412 | { |
| 413 | int len; |
| 414 | |
| 415 | if (!lenspot) |
| 416 | return; |
| 417 | |
| 418 | len = int(*stream - lenspot - 4); |
| 419 | WriteLong (len, &lenspot); |
| 420 | if (len & 1) |
| 421 | WriteByte (0, stream); |
| 422 | |
| 423 | lenspot = NULL; |
| 424 | } |
| 425 | |
| 426 | // Skip past an unknown chunk. *stream should be |
| 427 | // pointing to the chunk's length field. |