support libpng compiled without iTXt support

This commit is contained in:
Thomas Bernard 2019-06-29 11:03:14 +02:00
parent 836ad157fa
commit 1f6ceeaa3a
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C

View File

@ -6568,7 +6568,13 @@ void Load_PNG_Sub(T_IO_Context * context, FILE * file, const char * memory_buffe
while (num_text--) while (num_text--)
{ {
int size = COMMENT_SIZE; int size = COMMENT_SIZE;
#ifdef PNG_iTXt_SUPPORTED
size_t length = (text_ptr[num_text].compression >= 1) ? text_ptr[num_text].itxt_length : text_ptr[num_text].text_length; size_t length = (text_ptr[num_text].compression >= 1) ? text_ptr[num_text].itxt_length : text_ptr[num_text].text_length;
#else
size_t length = text_ptr[num_text].text_length;
if (text_ptr[num_text].compression >= 1)
continue; // skip iTXt
#endif
if (length > 0 && length < COMMENT_SIZE) if (length > 0 && length < COMMENT_SIZE)
size = (int)length; size = (int)length;
GFX2_Log(GFX2_DEBUG, "PNG Text %d \"%s\" (%ul bytes): %.*s\n", GFX2_Log(GFX2_DEBUG, "PNG Text %d \"%s\" (%ul bytes): %.*s\n",