comparison tools/libgfx.c @ 2025:307a52e0dc04

Make a internal copy of the const DMImageConvSpec in dmWriteIFFImage().
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 26 Oct 2018 09:54:51 +0300
parents 362fb8295f0c
children b137d324e13f
comparison
equal deleted inserted replaced
2024:f41bc7203a16 2025:307a52e0dc04
2064 else 2064 else
2065 return dmf_write_str(fp, buf, bufLen); 2065 return dmf_write_str(fp, buf, bufLen);
2066 } 2066 }
2067 2067
2068 2068
2069 int dmWriteIFFImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec) 2069 int dmWriteIFFImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *cpspec)
2070 { 2070 {
2071 Uint32 idsig; 2071 Uint32 idsig;
2072 DMIFF iff; 2072 DMIFF iff;
2073 Uint8 *buf = NULL; 2073 Uint8 *buf = NULL;
2074 size_t bufLen; 2074 size_t bufLen;
2075 int res = DMERR_OK; 2075 int res = DMERR_OK;
2076 DMImageConvSpec pspec, *spec = &pspec;
2077
2078 memcpy(&pspec, cpspec, sizeof(DMImageConvSpec));
2076 2079
2077 // XXX: Non-paletted ILBM not supported! 2080 // XXX: Non-paletted ILBM not supported!
2078 if (!spec->paletted) 2081 if (!spec->paletted)
2079 { 2082 {
2080 return dmError(DMERR_NOT_SUPPORTED, 2083 return dmError(DMERR_NOT_SUPPORTED,