Fix LodePNG to avoid -Wcast-qual warnings

<https://github.com/lvandeve/lodepng/issues/160>
This commit is contained in:
Rangi 2022-10-14 16:17:52 -04:00
parent 89a888277a
commit 90bec40276
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
.PHONY: all clean .PHONY: all clean
CC := gcc CC := gcc
CFLAGS := -O3 -flto -std=c11 -Wall -Wextra -pedantic -Wno-missing-field-initializers CFLAGS := -O3 -flto -std=c11 -Wall -Wextra -pedantic
tools := \ tools := \
bpp2png \ bpp2png \

View File

@ -4618,10 +4618,10 @@ static unsigned readChunk_iTXt(LodePNGInfo* info, const LodePNGDecoderSettings*
length, &zlibsettings); length, &zlibsettings);
/*error: compressed text larger than decoder->max_text_size*/ /*error: compressed text larger than decoder->max_text_size*/
if(error && size > zlibsettings.max_output_size) error = 112; if(error && size > zlibsettings.max_output_size) error = 112;
if(!error) error = lodepng_add_itext_sized(info, key, langtag, transkey, (char*)str, size); if(!error) error = lodepng_add_itext_sized(info, key, langtag, transkey, (const char*)str, size);
lodepng_free(str); lodepng_free(str);
} else { } else {
error = lodepng_add_itext_sized(info, key, langtag, transkey, (char*)(data + begin), length); error = lodepng_add_itext_sized(info, key, langtag, transkey, (const char*)(data + begin), length);
} }
break; break;