2021-04-04 10:37:58 (UTC-03:00)
Marcel Rodrigues <marcelgmr@gmail.com>
Don't try to write empty buffer at end of frame. As fixed by @rdebath in congif commit 730e1deb.
diff --git a/gifenc.c b/gifenc.c index 94c3579..c0e4e11 100644 --- a/gifenc.c +++ b/gifenc.c @@ -172,8 +172,10 @@ end_key(ge_GIF *gif) byte_offset = gif->offset / 8; if (gif->offset % 8) gif->buffer[byte_offset++] = gif->partial & 0xFF; - write(gif->fd, (uint8_t []) {byte_offset}, 1); - write(gif->fd, gif->buffer, byte_offset); + if (byte_offset) { + write(gif->fd, (uint8_t []) {byte_offset}, 1); + write(gif->fd, gif->buffer, byte_offset); + } write(gif->fd, "\0", 1); gif->offset = gif->partial = 0; }