Mercurial > hg > dmlib
changeset 1900:8c6040d5b930
Fix IFF chunk padding.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 26 Jun 2018 04:46:49 +0300 |
parents | 54baa688425b |
children | 636d3c8bcd35 |
files | tools/libgfx.c |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/libgfx.c Tue Jun 26 04:31:39 2018 +0300 +++ b/tools/libgfx.c Tue Jun 26 04:46:49 2018 +0300 @@ -1931,8 +1931,13 @@ return dmferror(fp); chunk->size = curr - chunk->offs - (sizeof(Uint32) * 2); - if ((chunk->size & 1) && !dmf_write_byte(fp, 0)) - return dmferror(fp); + if (chunk->size & 1) + { + if (!dmf_write_byte(fp, 0)) + return dmferror(fp); + + chunk->size++; + } if (dmfseek(fp, chunk->offs, SEEK_SET) < 0) return dmferror(fp);