|
|
{ | { |
png_warning(png_ptr, "Insufficient memory to process iCCP chunk."); | png_warning(png_ptr, "Insufficient memory to process iCCP chunk."); |
return; | return; |
} | } |
png_strncpy(new_iccp_name, name, png_strlen(new_iccp_name)+1); |
png_strncpy(new_iccp_name, name, png_strlen(name)); |
|
new_iccp_name[png_strlen(name)] = '\0'; |
new_iccp_profile = (png_charp)png_malloc_warn(png_ptr, proflen); | new_iccp_profile = (png_charp)png_malloc_warn(png_ptr, proflen); |
if (new_iccp_profile == NULL) | if (new_iccp_profile == NULL) |
{ | { |
png_free (png_ptr, new_iccp_name); | png_free (png_ptr, new_iccp_name); |
|
|
png_warning(png_ptr, | png_warning(png_ptr, |
"Out of memory while processing sPLT chunk"); | "Out of memory while processing sPLT chunk"); |
} | } |
/* TODO: use png_malloc_warn */ | /* TODO: use png_malloc_warn */ |
png_strncpy(to->name, from->name, png_strlen(from->name)+1); |
png_strncpy(to->name, from->name, png_strlen(from->name)); |
|
to->name[png_strlen(from->name)] = '\0'; |
to->entries = (png_sPLT_entryp)png_malloc_warn(png_ptr, | to->entries = (png_sPLT_entryp)png_malloc_warn(png_ptr, |
from->nentries * png_sizeof(png_sPLT_entry)); | from->nentries * png_sizeof(png_sPLT_entry)); |
/* TODO: use png_malloc_warn */ | /* TODO: use png_malloc_warn */ |
png_memcpy(to->entries, from->entries, | png_memcpy(to->entries, from->entries, |