comparison tools/libgfx.c @ 2020:57a2527ff63d

Fix IFF chunk padding.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 25 Oct 2018 18:47:10 +0300
parents e809e323fdde
children eb6dafdd36dc
comparison
equal deleted inserted replaced
2019:e809e323fdde 2020:57a2527ff63d
1942 return dmferror(fp); 1942 return dmferror(fp);
1943 1943
1944 chunk->size = curr - chunk->offs - (sizeof(Uint32) * 2); 1944 chunk->size = curr - chunk->offs - (sizeof(Uint32) * 2);
1945 if (chunk->size & 1) 1945 if (chunk->size & 1)
1946 { 1946 {
1947 dmMsg(3, "Padding chunk ID '%s', size %d ++\n",
1948 chunk->idStr, chunk->size);
1949
1947 if (!dmf_write_byte(fp, 0)) 1950 if (!dmf_write_byte(fp, 0))
1948 return dmferror(fp); 1951 return dmferror(fp);
1949 1952
1950 chunk->size++; 1953 curr++;
1951 } 1954 }
1952 1955
1953 if (dmfseek(fp, chunk->offs, SEEK_SET) < 0) 1956 if (dmfseek(fp, chunk->offs, SEEK_SET) < 0)
1954 return dmferror(fp); 1957 return dmferror(fp);
1955 1958